Re-implemented rotation without changing functionality.