Updated module to look and run better.

Fixed sensor retrieval functions by adding the formulas that were missing previously. Also, a lot nicer and readable code style.