refactored rotation example