added sensor class and code comments