Tested new code for sensors