anchor.diff:  
   -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) ->
  +build_failure_cells([], [], _Next, Acc) ->
       Acc;
  -build_failure_cells([], T, Next, [{P, Cell} | Acc]) ->
  +build_failure_cells([], T, _Next, [{P, Cell} | Acc]) ->
       [{P, lists:append(T, Cell)} | Acc];
  -build_failure_cells(P, [], Next, Acc) ->
  +build_failure_cells(_P, [], _Next, Acc) ->
       Acc;
   build_failure_cells([P | T], List, Next, Acc) ->
       Cell = lists:sublist(List, Next),
  
positive.code:     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),
      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)
                 end,
      FCells = lists:reverse(lists:keysort(1, build_failure_cells(FProbList, Keys, NextCell, []))),
      {DB, _, Out} = 
  
negative.code: 
  % @doc Generates a consistent db with errors
  -spec gen_kvv(ErrorDist::distribution(), [?RT:key()], [db_parameter()]) -> {?DB:db_as_list(), db_status()}.
  gen_kvv(EDist, Keys, Params) ->
      FType = proplists:get_value(ftype, Params, update),
      FProb = proplists:get_value(fprob, Params, 50),
      FDest = proplists:get_value(fdest, Params, all),    
      KeyCount = length(Keys),
      FCount =  erlang:round(KeyCount * (FProb / 100)),
      p_gen_kvv(EDist, Keys, KeyCount, FType, FDest, FCount).
  
  -spec p_gen_kvv(ErrorDist::distribution(), [?RT:key()], 
                  KeyCount::non_neg_integer(), failure_type(), 
                  failure_dest(), FailCount::non_neg_integer()) -> {?DB:db_as_list(), db_status()}.
  p_gen_kvv(random, Keys, KeyCount, FType, FDest, FCount) ->
      {FKeys, GoodKeys} = select_random_keys(Keys, FCount, []),    
      GoodDB = lists:foldl(fun(Key, AccDb) -> 
                                   lists:append(get_rep_group(Key), AccDb)
  