Added averaging to calculator