#include <algorithm> for std::max, std::min on VS2013.