Include <algorithm> when using std::min