link node revert algorithm