Fix the swap method