Another update to calculateAngle