min and max reduce