anchor.diff:  handoff_finished(_TargetNode, State) ->
       {ok, State}.
   
  -handle_handoff_data(Data, #state{partition=Partition, logs_map=Map}=State) ->
  -
  -    {Key, #operation{op_number=_OpId, payload=_Payload}=Operation} = binary_to_term(Data),
  -    DocIdx = riak_core_util:chash_key({?BUCKET,
  -                                       term_to_binary(Key)}),
  -    Preflist = riak_core_apl:get_primary_apl(DocIdx, ?N, replication),
  -    Keys= dict:fetch_keys(Map),
  -    lager:info("HANDOFF_DATA: Receiving data, key: ~w and operation: ~w. The preflist is: ~w and my partition is ~w. I have the following logs:~w~n",[Key, Operation, Preflist, Partition, Keys]),
  +handle_handoff_data(Data, #state{logs_map=Map}=State) ->
  +
  +    {Key, #operation{op_number=OpId, payload=Payload}} = binary_to_term(Data),
  +    Preflist = get_primaries_preflist(Key),
       case get_log_from_map(Map, Preflist) of
  -        {ok, _Log} ->
  -            %{ok, _OpId} = insert_operation(Log, Key, OpId, Payload),
  +        {ok, Log} ->
  +            {ok, _OpId} = insert_operation(Log, Key, OpId, Payload),
               {reply, ok, State};
           {error, Reason} ->
               {reply, {error, Reason}, State}
  
positive.code: 
  handle_handoff_command(?FOLD_REQ{foldfun=FoldFun, acc0=Acc0}, _Sender,
                         #state{logs_map=Map}=State) ->
  	lager:info("HANDOFF_FOLDING: Folding req  ~w~n", [node()]),
      F = fun({Key, Operation}, Acc) -> FoldFun(Key, Operation, Acc) end,
      Acc= join_logs(dict:to_list(Map), F, Acc0),
      
  
negative.code: 
  is_empty(State=#state{logs_map=Map}) ->
      Preflists = dict:fetch_keys(Map),
      case no_elements(Preflists, Map) of
          true ->
              {true, State};
          false ->
  