Swapped max and avg