Slight change to min max method in cuboid