Use foldl to calculate the average temperature