back to the old code for swapping