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:                     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: 
  % @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)
  