min was still being called instead of minimum here