takes out maxAverage variable