change min and max functions to accept numbers