added default for max and min