first draft sensor.js