Calculates average temperature