Abstracted sensors and added min threshold. Improved modularity.