get latest sensor data changed to return int