refactored rotation script again