anchor.diff:          _ ->
               Seed = erlang:phash2(now()),
               file:make_dir(Dir),
  -            file:write_file([Dir | "/mstore"],
  -                            io_lib:format("~p.", [{FileSize, NumFiles, Seed}])),
               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{size=FileSize, chash=CHash, dir=Dir, seed=Seed}}
  -    end.
  +            {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}, Metric, Time, Value)
  +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}),
  
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: 
  -record(mstore, {name, file, offset, size, index=gb_trees:empty(), next=0}).
  
  -record(mset, {size, chash, dir, seed, metrics=gb_sets:new()}).
  -define(DATA_SIZE, 8).
  -define(OPTS, [raw, binary]).
  -export([put/4, get/4, new/3, close/1, open/1, open/3, avg/3,
           sum/3, max/3, min/3, to_list/1, metrics/1]).
  
  
  %% @doc Opens an existing mstore.
  