minor tweaks to rotation code