anchor.diff:  handle_dht_msg({lb_active, Msg}, DhtState) ->
       DhtState.
   
  +manage_directories([]) ->
  +    ok;
  +manage_directories([DirKey | Rest]) ->
  +    directory_routine(DirKey, periodic),
  +    manage_directories(Rest).
  +
  +directory_routine(DirKey, Type) ->
  +    %% Because of the lack of virtual servers/nodes, the load
  +    %% balancing is differs from the paper here. We try to
  +    %% balance the most loaded node with the least loaded
  +    %% node.
  +    %% TODO Some preference should be given to neighboring
  +    %%      nodes to avoid too many jumps.
  +    {TLog, Directory} = get_directory(DirKey),
  +    Pool = Directory#directory.pool,
  +    K = case Type of
  +            periodic ->
  +                AvgUtil = lists:foldl(fun(El, Acc) -> Acc + El#node.utilization end, 0, Pool) / length(Pool),
  +                (1 + AvgUtil) / 2;
  +            emergency ->
  +                1.0
  +        end,
  +    LightNodes = gb_sets:filter(fun(El) -> El#node.utilization =< K end, Pool),
  +    HeavyNodes = gb_sets:filter(fun(El) -> El#node.utilization >  K end, Pool),
  +    Schedule = find_matches(LightNodes, HeavyNodes, []),
  +    NewDirectory = dir_set_schedule(Schedule, dir_clear_load(Directory)),
  +    %% TODO Should this be inside a transcaction? We may not want atomic attributes here
  +    set_directory(TLog, NewDirectory),
  +    ok.
  +
  +find_matches(LightNodes, HeavyNodes, Result) ->
  +    case gb_sets:size(LightNodes) > 0 andalso gb_sets:size(HeavyNodes) > 0 of
  +        true ->
  +            {LightNode, LightNodes2} = gb_sets:take_smallest(LightNodes),
  +            {HeavyNode, HeavyNodes2} = gb_sets:take_largest(HeavyNodes),
  +            find_matches(LightNodes2, HeavyNodes2, [{LightNode, HeavyNode} | Result]);
  +        false ->
  +            %% TODO we want to have the heaviest load first, this could be more efficient...
  +            lists:reverse(Result)
  +    end.
  +
  +-spec request_dht_range() -> ok.
   request_dht_range() ->
       MyDHT = pid_groups:get_my(dht_node),
       comm:send_local(MyDHT, {get_state, comm:this(), my_range}).
  
positive.code:     end,
      State;
  
  handle_msg({directory_trigger}, State) ->
      trigger(directory_trigger),
      MyDirectories = State#state.my_dirs,
      %Reassignments = [balance(Dir) || Dir <- MyDirectories],
      %PeriodicThreshold =
      %% Threshold k_p = Average laod in directory
      %% Threshold k_e = 1 meaning full capacity
      %% Upon receipt of load information:
  
negative.code:     %%  for every node from heavist to lightest in directory 
      %%    if l_n / c_n > k 
      %%       balance such that (l_n + l_x) / c_n gets minimized
      %%  return assignment
      MyDirKeys = State#state.my_dirs,
      manage_directories(MyDirKeys),
      State;
  
  handle_msg({get_state_response, MyRange}, State) ->
  