anchor.diff:      {ok, State}.
   
   
  --spec sorted_piecelist(pieceset(), array()) -> [pos_integer()].
  -sorted_piecelist(Piecelist, Numpeers) ->
  +-spec sorted_piecelist([pieceindex()], table()) -> [pieceindex()].
  +sorted_piecelist(Piecelist, Numpeers) when is_list(Piecelist) ->
       Tagged = [{ets:lookup_element(Numpeers, I, 2), I} || I <- Piecelist],
       Sorted = lists:sort(Tagged),
       [I || {_, I} <- Sorted].
   
   
  --spec decrement(pieceset(), array()) -> array().
  +-spec decrement(pieceset(), table()) -> table().
   decrement(Pieceset, Numpeers) ->
       etorrent_pieceset:foldl(fun(Piece, Acc) ->
           ets:update_counter(Numpeers, Piece, -1),
  
positive.code:     Numpeers.
  
  
  -spec increment(pieceset(), array()) -> array().
  increment(Pieceset, Numpeers) ->
      etorrent_pieceset:foldl(fun(Piece, Acc) ->
          ets:update_counter(Numpeers, Piece, 1),
  
negative.code: %% @end
  -spec start_link(torrent_id(), pos_integer()) -> {ok, pid()}.
  start_link(TorrentID, Numpieces) ->
      start_link(TorrentID, etorrent_timer:native(), Numpieces).
  
  
  -spec start_link(torrent_id(), timeserver(), pos_integer()) -> {ok, pid()}.
  start_link(TorrentID, Timeserver, Numpieces) ->
      gen_server:start_link(?MODULE, {TorrentID, Timeserver, Numpieces}, []).
  
  
  %% @doc Register as a peer
  