add min max method