[#5] fixed wrong usage of enumerable max and min methods