i'm pretty sure you want this to be std::min