Tweaking rotation logic.

If this doesn't work I may have to bring back the rotation cache.