finally fixed issue at extremes of rotation