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:             comm:send(node:pidX(RndNode), {lb_active, phase1, MyLBInfo, Options}, [{?quiet}]),
              State#state{rnd_node = []};
          RndNodes when IsValid ->
              This = comm:this(),
              ReqIds =
                  [begin
                        ReqId = randoms:getRandomInt(),
                        ?TRACE("Sending out simulate request with ReqId ~p to ~.0p~n", [ReqId, node:pidX(RndNode)]),
                        OptionsNew = [{simulate, ReqId}, {reply_to, This} | Options],
                        comm:send(node:pidX(RndNode), {lb_active, phase1, MyLBInfo, OptionsNew}, [{?quiet}]),
                        {ReqId, RndNode}
                   end || RndNode <- RndNodes],
  