use max/minValue instead of max/min