adds back swap and undo