small improvement to rotation code