Changed Max changed to Average