anchor.diff:                      % graceful leave (slide with succ, send all data)
                       % note: may also be a jump operation!
                       % TODO: check for running slide, abort it if possible, eventually extend it
  -                    % TODO(jump): notify node jumping to (?)
                       case slide_op:is_jump(Type) of
                           true ->
  -                            case dht_node_state:is_responsible(TargetId, State) orelse
  -                                     intervals:in(TargetId, dht_node_state:get(State, succ_range)) of
  +                            TIdInRange = dht_node_state:is_responsible(
  +                                                TId, State),
  +                            TIdInSuccRange =
  +                                intervals:in(TId,
  +                                             dht_node_state:get(State, succ_range)),
  +                            if % convert jump to slide?
  +                                TIdInRange     -> {ok, slide, succ, 'send'};
  +                                TIdInSuccRange -> {ok, slide, succ, 'rcv'};
                                   true ->
  -                                    % note: we could optimize here and not undergo all the checks again,
  -                                    % but this should not be a common case!
  -                                    % also: already checked in make_jump
  -                                    % (this is for the case when a message with the slide request is received which doesn't go through make_jump)
  -                                    make_slide(State, succ, TargetId, Tag, SourcePid);
  -                                _ ->
  -                                    case dht_node_state:get(State, slide_succ) =/= null andalso
  -                                             dht_node_state:get(State, slide_pred) =/= null of
  -                                        true ->
  -                                            SlideOp = slide_op:new_sending_slide_jump(
  -                                                        MoveFullId, TargetId, Tag, State),
  -                                            notify_other_slide(SlideOp, State);
  -                                        _ ->
  -                                            notify_source_pid(SourcePid,
  -                                                              {move, result, Tag, ongoing_slide}),
  -                                            State
  +                                    SlideSucc =
  +                                        dht_node_state:get(State, slide_succ),
  +                                    SlidePred =
  +                                        dht_node_state:get(State, slide_pred),
  +                                    case SlideSucc =/= null andalso
  +                                             SlidePred =/= null of
  +                                        true -> {ok, jump, 'send'};
  +                                        _    -> {abort, ongoing_slide}
                                       end
                               end;
  -                        _    ->
  -                            SlideOp = slide_op:new_sending_slide_leave(
  -                                        MoveFullId, leave, State),
  -                            notify_other_slide(SlideOp, State)
  +                        _ -> {ok, leave, 'send'}
                       end;
                   _ ->
  -                    TargetIdInRange = dht_node_state:is_responsible(TargetId, State),
  -                    SlideOp = slide_op:new_slide(MoveFullId, Type, TargetId, Tag, SourcePid, State),
  +                    TIdInRange = dht_node_state:is_responsible(TId, State),
                       SendOrReceive = slide_op:get_sendORreceive(Type),
  -                    case SendOrReceive of
  -                        'send' when TargetIdInRange andalso PredOrSucc =:= pred ->
  -                            % slide with pred, send data
  -                            State1 = dht_node_state:add_db_range(
  -                                       State, slide_op:get_interval(SlideOp)),
  -                            notify_other_slide(SlideOp, State1);
  -                        'send' when TargetIdInRange andalso PredOrSucc =:= succ ->
  -                            % slide with succ, send data
  -                            case First of
  -                                true -> notify_other_slide(SlideOp, State);
  -                                _    ->
  -                                    State1 = dht_node_state:add_db_range(
  -                                               State, slide_op:get_interval(SlideOp)),
  -                                    change_my_id(State1, SlideOp, TargetId)
  -                            end;
  -                        'send' -> % can not send if TargetId is not in my range!
  -                            abort_slide(State, SlideOp, target_id_not_in_range, not First);
  -                        'rcv' when PredOrSucc =:= pred ->
  -                            % slide with pred, receive data
  -                            State1 = dht_node_state:add_msg_fwd(
  -                                       State, slide_op:get_interval(SlideOp),
  -                                       node:pidX(slide_op:get_node(SlideOp))),
  -                            notify_other_slide(SlideOp, State1);
  -                        'rcv' when PredOrSucc =:= succ ->
  -                            % slide with succ, receive data
  -                            case First of
  -                                true -> notify_other_slide(SlideOp, State);
  -                                _    ->
  -                                    State1 = dht_node_state:add_msg_fwd(
  -                                               State, slide_op:get_interval(SlideOp),
  -                                               node:pidX(slide_op:get_node(SlideOp))),
  -                                    change_my_id(State1, SlideOp, TargetId)
  -                            end
  +                    case SendOrReceive =:= 'send' andalso not TIdInRange of
  +                        true -> {abort, target_id_not_in_range};
  +                        _    -> {ok, slide, PredOrSucc, SendOrReceive}
                       end
               end;
  -        _ when not CanSlide ->
  +        _ when not CanSlide -> {abort, ongoing_slide};
  +        _ when not NodesCorrect -> {abort, wrong_pred_succ_node};
  +        _ -> {ok, move_done} % MoveDone, i.e. target id already reached (noop)
  +    end.
  +
  +%% @doc Creates a new slide operation with the node's successor or
  +%%      predecessor and the given parameters according to the command created
  +%%      by check_setup_slide_not_found/5.
  +%%      Note: assumes that such a slide does not already exist.
  +-spec exec_setup_slide_not_found(
  +        Command::command(), State::dht_node_state:state(),
  +        Type::slide_op:type(), MoveFullId::slide_op:id(),
  +        TargetNode::node:node_type(),
  +        TargetId::?RT:key(), Tag::any(), MaxTransportBytes::pos_integer(),
  +        SourcePid::comm:erl_local_pid() | null, First::boolean())
  +            -> dht_node_state:state().
  +exec_setup_slide_not_found(Command, State, Type, MoveFullId, TargetNode,
  +                           TargetId, Tag, MaxTransportBytes, SourcePid, First) ->
  +    case Command of
  +        {abort, Reason} ->
               abort_slide(State, TargetNode, MoveFullId, null, SourcePid, Tag,
  -                        Type, ongoing_slide, not First);
  -        _ when not NodesCorrect ->
  -            abort_slide(State, TargetNode, MoveFullId, null, SourcePid, Tag,
  -                        Type, wrong_pred_succ_node, not First);
  -        _ -> % MoveDone, i.e. target id already reached (noop)
  +                        Type, Reason, not First);
  +        {ok, jump, 'send'} ->
  +            SlideOp = slide_op:new_sending_slide_jump(MoveFullId, TargetId, Tag, State),
  +            notify_other_slide(SlideOp, State);
  +        {ok, leave, 'send'} ->
  +            SlideOp = slide_op:new_sending_slide_leave(MoveFullId, leave, State),
  +            notify_other_slide(SlideOp, State);
  +        {ok, slide, pred, 'send'} ->
  +            % slide with pred, send data
  +            SlideOp = slide_op:new_slide(MoveFullId, Type, TargetId, Tag, SourcePid, State),
  +            State1 = dht_node_state:add_db_range(State, slide_op:get_interval(SlideOp)),
  +            notify_other_slide(SlideOp, State1);
  +        {ok, slide, succ, 'send'} ->
  +            % slide with succ, send data
  +            SlideOp = slide_op:new_slide(MoveFullId, Type, TargetId, Tag, SourcePid, State),
  +            case First of
  +                true -> notify_other_slide(SlideOp, State);
  +                _    -> State1 = dht_node_state:add_db_range(
  +                                   State, slide_op:get_interval(SlideOp)),
  +                        change_my_id(State1, SlideOp, TargetId)
  +            end;
  +        {ok, slide, pred, 'rcv'} ->
  +            % slide with pred, receive data
  +            SlideOp = slide_op:new_slide(MoveFullId, Type, TargetId, Tag, SourcePid, State),
  +            State1 = dht_node_state:add_msg_fwd(
  +                       State, slide_op:get_interval(SlideOp),
  +                       node:pidX(slide_op:get_node(SlideOp))),
  +            notify_other_slide(SlideOp, State1);
  +        {ok, slide, succ, 'rcv'} ->
  +            % slide with succ, receive data
  +            SlideOp = slide_op:new_slide(MoveFullId, Type, TargetId, Tag, SourcePid, State),
  +            case First of
  +                true -> notify_other_slide(SlideOp, State);
  +                _    -> State1 = dht_node_state:add_msg_fwd(
  +                                   State, slide_op:get_interval(SlideOp),
  +                                   node:pidX(slide_op:get_node(SlideOp))),
  +                        change_my_id(State1, SlideOp, TargetId)
  +            end;
  +        {ok, move_done} ->
  +            % TODO: notify other node if not first
               notify_source_pid(SourcePid, {move, result, Tag, ok}),
               State
       end.
  
positive.code:     MoveFullId = util:get_global_uid(),
      MyNode = dht_node_state:get(State, node),
      TargetNode = dht_node_state:get(State, PredOrSucc),
      setup_slide_with(State, {slide, PredOrSucc, SendOrReceive},
                       MoveFullId, MyNode, TargetNode, TargetId, Tag,
                       get_max_transport_bytes(), SourcePid, true).
  
  %% @doc Creates a slide with the node's predecessor. The predecessor will
  %%      change its ID to TargetId, SourcePid will be notified about the result.
  
negative.code:         _ -> comm:send_local(SourcePid, Message)
      end.
  
  %% @doc Aborts the given slide operation. Assume the SlideOp has already been
  %%      set in the dht_node and resets the according slide in its state to
  %%      null.
  %% @see abort_slide/8
  -spec abort_slide(State::dht_node_state:state(), SlideOp::slide_op:slide_op(),
          Reason::abort_reason(), NotifyNode::boolean()) -> dht_node_state:state().
  