Replaced swapf with a rotatef-based definition