Added code for sensors.