more work, added sensor functions