Implemented a simple divisor logic to handle rotation.