Added getAngle function