swap a pair of links