implemented max and min