included <algorithm> to make sure all compilers find std::max with no errors
Merge pull request #4015 from Bigpet/master

included <algorithm> to make sure all compilers find std::max