anchor.diff:      {ok, _} = ?scarcity:start_link(6, 8),
       Main = self(),
       Pid = spawn_link(fun() ->
  -        {ok, _} = ?scarcity:add_peer(6),
  -        {ok, _} = ?scarcity:add_piece(6, 0),
  -        {ok, _} = ?scarcity:add_piece(6, 2),
  +        ok = ?scarcity:add_peer(6, pieces([])),
  +        ok = ?scarcity:add_piece(6, 0, pieces([0])),
  +        ok = ?scarcity:add_piece(6, 2, pieces([0,2])),
           Main ! done,
           receive die -> ok end
       end),
       receive done -> ok end,
       Pieces  = ?pieceset:from_list([0,1,2,3,4,5,6,7], 8),
  -    {ok, O1} = ?scarcity:get_order(6, Pieces),
  +    {ok, O1} = ?scarcity:get_order(6, pieces([0,1,2,3,4,5,6,7])),
       ?assertEqual([1,3,4,5,6,7,0,2], O1),
       Ref = monitor(process, Pid),
       Pid ! die,
  
positive.code: 
  %% @doc
  %% @end
  -spec add_peer(torrent_id()) -> {ok, pieceset()}.
  add_peer(TorrentID) ->
      SrvPid = lookup_scarcity_server(TorrentID),
      gen_server:call(SrvPid, {add_peer, self()}).
  
  
  %% @doc
  %% @end
  -spec add_piece(torrent_id(), pos_integer()) -> {ok, pieceset()}.
  add_piece(TorrentID, PieceIndex) ->
      SrvPid = lookup_scarcity_server(TorrentID),
      gen_server:call(SrvPid, {add_piece, self(), PieceIndex}).
  
  %% @doc
  %% @end
  
negative.code: 
  
  %% @private
  handle_call({add_peer, PeerPid, Pieceset}, _, State) ->
      #state{num_pieces=NumPieces, peer_monitors=Monitors} = State,
      NewMonitors = etorrent_monitorset:insert(PeerPid, Pieceset, Monitors),
      NewState = State#state{peer_monitors=NewMonitors},
      {reply, ok, NewState};
  
  handle_call({add_piece, Pid, PieceIndex, Pieceset}, _, State) ->
      #state{peer_monitors=Monitors, num_peers=Numpeers} = State,
      Prev = array:get(PieceIndex, Numpeers),
      NewNumpeers = array:set(PieceIndex, Prev + 1, Numpeers),
      NewMonitors = etorrent_monitorset:update(Pid, Pieceset, Monitors),
      NewState = State#state{
          peer_monitors=NewMonitors,
          num_peers=NewNumpeers},
      {reply, ok, NewState};
  
  handle_call({get_order, Pieceset}, _, State) ->
      #state{num_peers=Numpeers} = State,
  