Updated the rotation logic