Update and rename swapPairs to Swap Nodes in Pairs