anchor.diff:  
       #scarcity{counters=NewCounters, ordering=NewOrdering}.
   
  -   
  -
  -
  -%% @doc
  -%%
  +
  +%% @doc
  +%% Increment the number of peers providing a piece by one and
  +%% reprioritize the pieces in the scarcity list.
   %% @end
   -spec increment(pos_integer(), #scarcity{}) -> scarcity().
   increment(Index, Scarcity) ->
       #scarcity{counters=Counters, ordering=Ordering} = Scarcity,
       assert_member(Index, Counters),
   
  -    Count = array:get(Index, Counters),
  -    NewCounters = array:set(Index, Count + 1, Counters),
  +    Count    = array:get(Index, Counters),
  +    NewCount = Count + 1,
  +    NewCounters = array:set(Index, NewCount, Counters),
       TmpOrdering = gb_sets:delete({Count, Index}, Ordering),
  -    NewOrdering = gb_sets:insert({Count + 1, Index}, TmpOrdering),
  +    NewOrdering = gb_sets:insert({NewCount, Index}, TmpOrdering),
   
       #scarcity{counters=NewCounters, ordering=NewOrdering}.
   
  
positive.code: 
  
  %% @doc
  %%
  %% @end
  -spec insert(pos_integer(), pos_integer(), #scarcity{}) -> scarcity().
  insert(Index, Count, Scarcity) ->
      #scarcity{counters=Counters, ordering=Ordering} = Scarcity,
      assert_not_member(Index, Counters),
  
      NewCounters = array:set(Index, Count, Counters),
      NewOrdering = gb_sets:insert({Count, Index}, Ordering),
  
      #scarcity{counters=NewCounters, ordering=NewOrdering}.
  
  %% @doc
  %%
  %% @end
  -spec delete(pos_integer(), #scarcity{}) -> scarcity().
  delete(Index, Scarcity) ->
  
negative.code:     ?assertEqual([1,2,0], ?mod:to_list(S4)).
  
  decrement_test() ->
      S0 = ?mod:from_list([{0,0}, {1,1}, {2,4}]),
      S1 = ?mod:decrement(2, S0),
      S2 = ?mod:decrement(2, S1),
      S3 = ?mod:decrement(2, S2),
  