added code for temperature sensing