anchor.diff:  
   open(Dir) ->
       case file:consult([Dir | "/mstore"]) of
  -        {ok, [{FileSize, NumFiles, Seed}]} ->
  -            {ok, #mset{size=FileSize, chash=chash:fresh(NumFiles, []), dir=Dir, seed=Seed}};
  +        {ok, [{FileSize, NumFiles, Seed, Metrics}]} ->
  +            {ok, #mset{size=FileSize, chash=chash:fresh(NumFiles, []), dir=Dir, seed=Seed, metrics=gb_sets:from_list(Metrics)}};
           _ ->
               {error, not_found}
       end.
  
positive.code:     Parts = make_splits(Time, Count, S, []),
      CurFiles = chash:lookup(Idx, CHash),
      Parts1 = [{B, round(C*?DATA_SIZE)} || {B, C} <- Parts],
      case do_put(MSet#mset{dir=[D, $/, integer_to_list(Idx)]}, Metric, Parts1, Value, CurFiles) of
          CurFiles1 when CurFiles1 =:= CurFiles ->
              MSet;
          CurFiles1 ->
              CHash1 = chash:update(Idx, CurFiles1, CHash),
              MSet#mset{chash = CHash1}
      end;
  
  
  
negative.code:         _ ->
              Seed = erlang:phash2(now()),
              file:make_dir(Dir),
              CHash = {_, Idxs} = chash:fresh(NumFiles, []),
              MSet = #mset{size=FileSize, chash=CHash, dir=Dir, seed=Seed},
              save_set(MSet),
              [file:make_dir([Dir, $/ | integer_to_list(I)]) || {I, _} <- Idxs],
              {ok, MSet}
      end.
  save_set(#mset{dir=D, size=Size, chash=CHash, seed=Seed,metrics=Metrics}) ->
      NumFiles = chash:size(CHash),
      file:write_file([D | "/mstore"],
                      io_lib:format("~p.", [{Size, NumFiles, Seed, gb_sets:to_list(Metrics)}])).
  
  
  metrics(#mset{metrics=M}) ->
      gb_sets:to_list(M).
  
  put(MSet, Metric, Time, Values)
    when is_list(Values) ->
      put(MSet, Metric, Time, << <<V:64/integer>> || V <- Values >>);
  
  put(MSet = #mset{size=S, chash=CHash, seed=Seed, dir=D, metrics=Ms},
      Metric, Time, Value)
    when is_binary(Value)
         ->
      <<IndexAsInt:160/integer>> = chash:key_of({Seed, Metric}),
  