final changes for the swapping mode