anchor.diff:      Insert = length(GoodDB) + length(BadDB),
       DBSize = KeyCount * ?ReplicationFactor,
       {lists:append(GoodDB, BadDB), {DBSize, Insert, DBSize - Insert, O}};
  -gen_kvv({non_uniform, Fun}, Keys, Params) ->
  -    FType = proplists:get_value(ftype, Params, update),
  -    FDest = proplists:get_value(fdest, Params, all),
  -    FProb = proplists:get_value(fprob, Params, 50),
  +p_gen_kvv({non_uniform, Fun}, Keys, KeyCount, FType, FDest, FCount) ->
       FProbList = get_non_uniform_probs(Fun, []),
  -    KeysL = length(Keys),
  -    FCount = erlang:round(KeysL * (FProb / 100)),
       NextCell = case length(FProbList) of
  -                   0 -> KeysL + 1;
  -                   FProbL -> erlang:round(KeysL / FProbL)
  +                   0 -> KeyCount + 1;
  +                   FProbL -> erlang:round(KeyCount / FProbL)
                  end,
       FCells = lists:reverse(lists:keysort(1, build_failure_cells(FProbList, Keys, NextCell, []))),
       {DB, _, Out} = 
  
positive.code:                     end, 
                      {[], FCount, 0}, FCells),
      Insert = length(DB),
      DBSize = KeysL * ?ReplicationFactor,
      {DB, {DBSize, Insert, DBSize - Insert, Out}};
  gen_kvv(uniform, Keys, Params) ->
      FType = proplists:get_value(ftype, Params, update),
      FProb = proplists:get_value(fprob, Params, 50),
      FDest = proplists:get_value(fdest, Params, all),
      KeyL = length(Keys),
      FRate = case FProb of 
                  0 -> KeyL + 1;
                  _ -> erlang:round(100 / FProb)
              end,
      {DB, O, _} = 
          lists:foldl(
            fun(Key, {AccDb, Out, Count}) ->
                    {RList, AddOut} = case Count rem FRate of
                                          0 -> get_failure_rep_group(Key, FType, FDest);
                                          _ -> {get_rep_group(Key), 0}
                                      end,
                    {lists:append(RList, AccDb), Out + AddOut, Count + 1}
            end, 
            {[], 0, 1}, Keys),
      Insert = length(DB),
      DBSize = KeyL * ?ReplicationFactor,    
      {DB, {DBSize, Insert, DBSize - Insert, O}}.
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
negative.code: 
  -spec build_failure_cells([float()], [?RT:key()], non_neg_integer(), Acc::Res) -> Result::Res
      when is_subtype(Res, [{float(), [?RT:key()]}]).
  build_failure_cells([], [], _Next, Acc) ->
      Acc;
  build_failure_cells([], T, _Next, [{P, Cell} | Acc]) ->
      [{P, lists:append(T, Cell)} | Acc];
  build_failure_cells(_P, [], _Next, Acc) ->
      Acc;
  build_failure_cells([P | T], List, Next, Acc) ->
      Cell = lists:sublist(List, Next),
  