update min max method