anchor.diff:          Id ->
               Best = State#state.best_candidate,
               BestCandidate =
  -                case proplists:get_value(requests, Best) of
  -                    {_LoadChange, Node} -> Node;
  +                case lists:keysearch(requests, 1, Best) of
  +                    {value, {requests, {_LoadChange, Node}}} -> Node;
                       _ ->
  -                        case proplists:get_value(items, Best) of
  -                            {_LoadChange, Node} -> Node;
  +                        case lists:keysearch(items, 1, Best) of
  +                            {value, {requests, {_LoadChange, Node}}} -> Node;
                               _ -> nil
                           end
                   end,
  
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:     case State#state.round_id of
          Id ->
              ReqIds = State#state.req_ids,
              ReqIdsNew = lists:keydelete(ThisReqId, 1, ReqIds),
              case ReqIdsNew of
                  [] -> comm:send_local(self(), {pick_best_candidate, Id});
                  _  -> ok
              end,
              {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}
              end;
          _ ->
             ?TRACE("Discarding old round with Id ~p~n", [Id]),
  