anchor.diff:      PV = ds_pvattrs:add(A, PV0),
       Tree = gb_trees:update(Hash, {V, PV}, Tree0),
       Sampler#sampler{tree = Tree};
  -add_hash({Hash, VA}, #sampler{capacity = Capacity,
  -                              size = Size0, tree = Tree0} = Sampler) ->
  -    {Tree1, Size1} = update_tree(Hash, VA, Tree0, Size0),
  +add_hash({Hash, {V, A}}, #sampler{capacity = Capacity,
  +                                  size = Size0, tree = Tree0} = Sampler) ->
  +    {Tree1, Size1} = update_tree(Hash, {V, A}, Tree0, Size0),
       if Size1 > Capacity ->
               {_, Value, Tree} = gb_trees:take_largest(Tree1),
               Size = case Value of
  -                       {_V,_PV} -> Size1 - 1;
  +                       {_Vmax,_PV} -> Size1 - 1;
                          Bucket -> Size1 - length(Bucket)
                      end,
               {MaxHash, _} = gb_trees:largest(Tree),
  
positive.code:     [?assertEqual(2, Count) || Count <- CountsFromS1],
      ?print(Sj2).
  
  -endif.
  
negative.code: %% hash function (erlang:phash2 with the Range set to 2^32 is recommended).
  %% In case of doubt, just use add/2 above.
  add_hash(_Data, undefined) -> undefined;
  add_hash({Hash, {V, A}}, #sampler{capacity = Capacity,
                                    size = Size0, tree=Tree0,
                                    max_hash = MaxHash0} = Sampler)
    when Size0 < Capacity ->
      {Tree, Size} = update_tree(Hash, {V, A}, Tree0, Size0),
      MaxHash = max(Hash, MaxHash0),
      Sampler#sampler{size = Size, max_hash = MaxHash, tree = Tree};
  add_hash({Hash, {_V,_A}}, #sampler{max_hash = MaxHash} = Sampler)
    when Hash > MaxHash ->
      Sampler;
  add_hash({Hash, {V, A}}, #sampler{max_hash = MaxHash,
  