anchor.diff:  
   -type utilization() :: float().
   
  --record(node, {utilization = ?required(node, utilization)    :: utilization(),
  +-record(node, {utilization = ?required(node, utilization)    :: utilization(), %% erlang sorts by first element in record/tuple
  +               pid      = ?required(node, pid)               :: comm:mypid(),
                  capacity = 1                                  :: number(),
  -               load     = ?required(node, load)              :: number(),
  -               pid      = ?required(node, pid)               :: comm:mypid()
  +               load     = ?required(node, load)              :: number()
                  }).
   
   -type directory_name() :: string().
   
   -record(directory, {name         = ?required(directory, name) :: directory_name(), 
                       last_balance = nil                        :: nil | os:timestamp(),
  -                    pool         = gb_sets:new()              :: gb_set()
  -                    %light_nodes  = []                         :: [node()],
  -                    %heavy_nodes  = []                         :: [node()]
  +                    pool         = gb_sets:new()              :: gb_set(),
  +                    schedule     = []                         :: [reassign()]
                       }).
  +
  +-record(reassign, {from = ?required(reassign, from) :: node:node_type(),
  +                   to   = ?required(reassign, to)   :: node:node_type()
  +                   }).
  +
  +-type reassign() :: #reassign{}.
   
   -record(state, {capacity = 1500, %% free cpu usage, free memory, bandwith...
                   my_dirs = [],
  
positive.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 
      ?TRACE("~p My Directories: ~p~n", [self(), State#state.my_dirs]),
      State;
  
  handle_msg({get_state_response, MyRange}, State) ->
  
negative.code: 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}).
  