Changed the way to calculate the angle from the accelerometer
