anchor.diff:      % Choke everyone else
       choke_peers(Rest),
   
  -    S.
  -
  -find_fastest_peers(_N, Interested) ->
  -    {Interested, []}.
  +    DoNotTouchPids = sets:from_list(lists:map(fun({K, _V}) -> K end,
  +					     Downloaders)),
  +    {S, DoNotTouchPids}.
  +
  +remove_optimistic_unchoking(S) ->
  +    peer_dict_map(fun(_K, PI) ->
  +			  PI#peer_info{optimistic_unchoke = false}
  +		  end,
  +		  S).
  +
  +find_fastest_downloaders(N, Interested) ->
  +    List = lists:sort(
  +	     fun ({_K1, PI1}, {_K2, PI2}) ->
  +		     PI1#peer_info.downloaded > PI2#peer_info.downloaded
  +	     end,
  +	     dict:to_list(Interested)),
  +    PidList = lists:map(fun({K, _V}) -> K end, List),
  +    SplitPoint = lists:min([length(PidList), N]),
  +    {Downloaders, Rest} = lists:split(SplitPoint, PidList),
  +    {Downloaders, Rest}.
   
   unchoke_peers(Pids) ->
       lists:foreach(fun(P) -> torrent_peer:unchoke(P) end, Pids),
  
positive.code: %%% Internal functions
  %%--------------------------------------------------------------------
  
  %%--------------------------------------------------------------------
  %% Function: perform_choking_unchoking(state()) -> state()
  %% Description: Peform choking and unchoking of peers according to the
  
negative.code: -record(peer_info, {uploaded = 0,
  		    downloaded = 0,
  		    interested = false,
  		    remote_choking = true,
  
  		    optimistic_unchoke = false,
  		    ip = none,
  		    port = 0,
  		    peer_id = none}).
  