add solution for swap node problem