Created new version of final code
Renamed sensor variables
Renamed subroutines, fixed indentation, fixed syntax errors