added getAngle function