add method to calculate averages