added code used by the sensor