Added calculateAngle