getTemperature example: add comments, some code cleaning