Cleaning up code
Cleaning up code, switch to useing magnet and accelerometer instead of gyroscope