get rid of #define max and use stl::max