switching max min to min max...