adding getAverage() method