built a Thermometer class and rearchitected to use events