Added logic to print the temperature.