added calculateAverage