made sensors.cpp more readable