anchor.diff:  
   split_preferred(Peers) ->
       {Downs, Leechs} = split_preferred_peers(Peers, [], []),
  -    %% Notice that the rate on which we sort is negative, so the fastest peer is actually first in the list
  +    %% Notice that the rate on which we sort is negative,
  +    %% so the fastest peer is actually first in the list
       {lists:keysort(#rechoke_info.rate, Downs),
        lists:keysort(#rechoke_info.rate, Leechs)}.
   
  
positive.code:             {value, Snubbed, St} = etorrent_peer_states:get_state(Id, Pid),
              case lookup_info(Seeding, Id, Pid) of
                  none -> build_rechoke_info(Seeding, Next);
                  {State, R} -> [#rechoke_info {
                                      pid = Pid,
                                      peer_state = PeerState,
                                      state = State,
                                      rate = R,
                                      r_interest_state = proplists:get_value(interest_state, St),
                                      r_choke_state    = proplists:get_value(choke_state, St),
                                      l_choke          = proplists:get_value(local_choke, St),
                                      peer_snubs = Snubbed } |
                              build_rechoke_info(Seeding, Next)]
              end
      end.
  
  advance_optimistic_unchoke(S) ->
      NewChain = move_cyclic_chain(S#state.opt_unchoke_chain),
      case NewChain of
  
negative.code: %% Otherwise, We have K excess slots we can move from S to D.
  shuffle_seeder_slots(S, D, SLen) ->
      case lists:max([0, S - SLen]) of
          0 -> {S, D};
          K -> {S - K, D + K}
      end.
  
  %% Figure out how many seeder and leecher slots we need. If there is a surplus
  %% for Leechers, say, we push those onto the seeder group and vice versa.
  %% This ensures we use all the slots we can possibly use. We return a set
  %% of the peers we prefer.
  find_preferred_peers(SDowns, SLeechs) ->
      MaxUploads = upload_slots(),
      DSlots = lists:max([1, round(MaxUploads * 0.7)]),
      SSlots = lists:max([1, round(MaxUploads * 0.3)]),
      {SSlots2, DSlots2} = shuffle_leecher_slots(SSlots, DSlots, length(SDowns)),
      {SSlots3, DSlots3} =
          shuffle_seeder_slots(SSlots2, DSlots2, length(SLeechs)),
      {TSDowns, TSLeechs} = {lists:sublist(SDowns, DSlots3),
                             lists:sublist(SLeechs, SSlots3)},
      sets:union(sets:from_list(TSDowns), sets:from_list(TSLeechs)).
  