Used wrapAngle to avoid overflow