anchor.diff:                                     Primaries
                              end,
               NewTotal = Total + 1,
  -            case enoughReplies(W, PW, NewPrimaries, NewTotal) of
  +            NewState = case enoughReplies(W, PW, NewPrimaries, NewTotal) of
                   true ->
  -                    erlang:erase(ReqId),
  -                    reply(From, ReqId, ok);
  +                    {_, S} = do_erase(ReqId, State),
  +                    reply(From, ReqId, ok),
  +                    S;
                   false ->
  -                    erlang:put(ReqId, Rec#rec{primaries = NewPrimaries, total = NewTotal})
  +                    {_, S} = do_put(ReqId, Rec#rec{primaries = NewPrimaries, total = NewTotal}, State),
  +                    S
               end,
  -            {noreply, State}
  +            {noreply, NewState}
       end;
   handle_info(_Msg, State) ->
       {noreply, State}.
  
positive.code:     primaries = 0,
      total = 0,
      from
  }).
  
  -define(DEFAULT_TIMEOUT, 60000).
  
negative.code: 
  %% See riak_kv_ensemble_router:random for justification
  random(N) ->
      erlang:phash2(erlang:statistics(io), N) + 1.
  
  
  do_put(ReqId, Rec, #state{entries=Entries} = State) ->
      case do_get(ReqId, State) of
          undefined ->
              {undefined, State#state{entries=?DICT_TYPE:store(ReqId, Rec, Entries)}};
          OldValue ->
              {OldValue, State#state{entries=?DICT_TYPE:store(ReqId, Rec, Entries)}}
      end.
  
  do_get(ReqId, #state{entries=Entries} = _State) ->
      case ?DICT_TYPE:find(ReqId, Entries) of
          {ok, Value} -> Value;
          error -> undefined
      end.
  
  do_erase(ReqId, #state{entries=Entries} = State) ->
      case do_get(ReqId, State) of
          undefined ->
              {undefined, State};
          OldValue ->
              {OldValue, State#state{entries=?DICT_TYPE:erase(ReqId, Entries)}}
      end.
  