make min and max work

if you use std::min/max you must include algorithm