anchor.diff:      case State#state.round_id of
           Id ->
               ReqIds = State#state.req_ids,
  -            ReqIdsNew = proplists:delete(ThisReqId, ReqIds),
  +            ReqIdsNew = lists:keydelete(ThisReqId, 1, ReqIds),
               case ReqIdsNew of
                   [] -> comm:send_local(self(), {pick_best_candidate, Id});
                   _  -> ok
               end,
  -            NodeX = proplists:get_value(ThisReqId, ReqIds),
  +            {value, {ThisReqId, NodeX}} = lists:keysearch(ThisReqId, 1, ReqIds),
   
               Best = State#state.best_candidate,
               {BestLoadChange, _Node} = proplists:get_value(Metric, Best, {0, nil}),
   
               case LoadChange < BestLoadChange of
  -                    true  ->
  -                        NewBest = lists:keystore(Metric, 1, Best, {Metric, {LoadChange, NodeX}}),
  -                        State#state{req_ids = ReqIdsNew,
  -                                    best_candidate = NewBest};
  -                    _ ->
  -                        State#state{req_ids = ReqIdsNew}
  +                true  ->
  +                    NewBest = lists:keystore(Metric, 1, Best, {Metric, {LoadChange, NodeX}}),
  +                    State#state{req_ids = ReqIdsNew,
  +                                best_candidate = NewBest};
  +                _ ->
  +                    State#state{req_ids = ReqIdsNew}
               end;
           _ ->
              ?TRACE("Discarding old round with Id ~p~n", [Id]),
  
positive.code: %% assuming the two nodes are neighbors. If not we'll contact
  %% the light node's successor for more load information.
  handle_dht_msg({lb_active, phase1, NodeX, Options}, DhtState) ->
      Epsilon = proplists:get_value(epsilon, Options),
  	MyLBInfo = lb_info:new(dht_node_state:details(DhtState)),
      IsValid = lb_info:is_valid(MyLBInfo),
  	MyLoad = lb_info:get_load(MyLBInfo),
  	LoadX = lb_info:get_load(NodeX),
  	case MyLoad =/= 0 orelse LoadX =/= 0 of
  		true when IsValid ->
  			if
                  % first check if load balancing is necessary
  				MyLoad =< Epsilon * LoadX ->
  					?TRACE("My node is light~n", []),
  					balance_adjacent(NodeX, MyLBInfo, Options);
  				LoadX =< Epsilon * MyLoad ->
  					?TRACE("My node is heavy~n", []),
  					balance_adjacent(MyLBInfo, NodeX, Options);
  				true ->
  					%% no balancing
  					?TRACE("Won't balance~n", []),
                      lb_active:balance_noop(Options)
  			end;
  		_ -> lb_active:balance_noop(Options)
  	end,
  	DhtState;
  
  %% Second phase: We are LightNode's successor. We might hold
  
negative.code: 	MyLBInfo = lb_info:new(dht_node_state:details(DhtState)),
      IsValid = lb_info:is_valid(MyLBInfo),
  	MyLoad = lb_info:get_load(MyLBInfo),
      LoadHeavyNode = lb_info:get_load(HeavyNode),
      if IsValid andalso MyLoad > LoadHeavyNode ->
             % slide
             lb_active:balance_nodes(HeavyNode, LightNode, Options);
         IsValid ->
             % jump
             lb_active:balance_nodes(HeavyNode, LightNode, MyLBInfo, Options);
         true -> ok
      end,
  	DhtState.
  
  %%%%%%%%%%%%%%%%%%%%
  