swap nodes