anchor.diff:              gb_trees:enter(PredId, NewPred,
                   gb_trees:enter(SuccId, NewSucc, Tree))
       end,
  -    Ns = gb_trees:values(UpdatedTree),
  -
  -    %% TODO DELETE ASSERT
  -    Adjs = [tuple_to_list(adjacent_fingers(N)) || N <- Ns],
  -    Ids = lists:flatten(Adjs),
  -    false = lists:any(fun (none) -> true; (_) -> false end, [gb_trees:lookup(N,
  -                UpdatedTree) || N <- Ids]),
  +
       RT#rt_t{nodes=UpdatedTree}.
   
   % @doc Create an rt_entry and return the entry together with the Pred und Succ node, where
  
positive.code: %% @end
  %% @version $Id$
  
  %% TODO check if calls to empty/1 should be replaced with calles to init/1
  -module(rt_frtchord).
  -author('mamuelle@informatik.hu-berlin.de').
  -vsn('$Id$').
  
negative.code:                                 "{int(), int()}");
              _ -> false
          end.
  
  
  
  %% @doc Generate a random key from the pdf as defined in (Nagao, Shudo, 2011)
  % TODO unit test that the generator doesn't generate keys from outside ?MINUS_INFINITY
  % to ?PLUS_INFINITY
  %% TODO
  %I floor the key for now; the key generator should return ints, but returns
  %float. It is currently unclear if this is a bug in the original paper by Nagao and
  %Shudo. Using erlang:trunc/1 should be enough for flooring, as X >= 0
  % TODO using the remainder might destroy the CDF. why can X > 2^128?
  -spec get_random_key_from_generator(SourceNodeId :: key(),
                                      PredId :: key(),
                                      SuccId :: key()
                                     ) -> key().
  get_random_key_from_generator(SourceNodeId, PredId, SuccId) ->
      Rand = random:uniform(),
      X = SourceNodeId + get_range(SourceNodeId, SuccId) *
          math:pow(get_range(SourceNodeId, PredId) /
                      get_range(SourceNodeId, SuccId),
                      Rand
                  ),
      erlang:trunc(X) rem 16#100000000000000000000000000000000
      .
  
  %% userdevguide-begin rt_frtchord:handle_custom_message
  %% @doc Handle custom messages. The following messages can occur:
  