Rewrote Sensor code to incorporate timing. Minimized use of global variables. Slight naming changes.