now calculates average