Rewrote sensor initialization and event handlers

Found a new template, tried again