anchor.diff:  %% @doc Creates new DB handle named DBName.
   -spec new(DBName::nonempty_string()) -> db().
   new(DBName) ->
  +    %% IMPORTANT: this module only works correctly when using ordered_set ets
  +    %% tables. Other table types could throw bad_argument exceptions while
  +    %% calling ets:next/2
       ets:new(list_to_atom(DBName), [ordered_set | ?DB_ETS_ADDITIONAL_OPS]).
   
   %% @doc Open a previously existing database. Not supported by ets.
  
positive.code: foldl(_DB, _Fun, Acc, {interval, _, '$end_of_table', _End, _}, _MaxNum) -> Acc;
  foldl(_DB, _Fun, Acc, {interval, _, _Start, '$end_of_table', _}, _MaxNum) -> Acc;
  foldl(_DB, _Fun, Acc, {interval, _, Start, End, _}, _MaxNum) when Start > End -> Acc;
  foldl(DB, Fun, Acc, {element, El}, _MaxNum) -> 
      case ets:lookup(DB, El) of
          [] ->
              Acc;
  
negative.code: foldr(DB, Fun, Acc, all, MaxNum) ->
      foldr(DB, Fun, Acc, {interval, '[', ets:first(DB), ets:last(DB), ']'},
            MaxNum);
  foldr(DB, Fun, Acc, {interval, '(', End, Start, RBr}, MaxNum) ->
      foldr(DB, Fun, Acc, {interval, '[', ets:next(DB, End), Start, RBr}, MaxNum);
  foldr(DB, Fun, Acc, {interval, LBr, End, Start, ')'}, MaxNum) ->
      foldr(DB, Fun, Acc, {interval, LBr, End, ets:prev(DB, Start), ']'}, MaxNum);
  foldr(DB, Fun, Acc, {interval, '[', End, Start, ']'}, MaxNum) ->
      case ets:lookup(DB, Start) of
  