swap every pair of nodes