CalculateAverage method