include <algorithm> for use of std::min().