added getAvgTemp function