pass in max min