temperature's max and min updating improved