added test for max and min