replace min and max with minimum and maximum

This time should be fine.