anchor.diff:  %% combine the ranges within two continuous branches if possible.
   extend_range(SuffixTree) ->
       extend_range([],SuffixTree).
  +
   extend_range(_Prev_Range, {branch, {Range, {Len, Freq}}, leaf}) ->
  -     {branch, {Range, {Len,Freq}}, leaf};
  -extend_range(Prev_Range,{branch, {Range, {Len, Freq}}, Bs}) -> 
  -     ExtendedRange = lists:map(fun(R) -> combine_range(Prev_Range, R) end, Range),
  -     case overlapped_range(ExtendedRange) orelse
  - 	 (lists:subtract(ExtendedRange, Range) =/= ExtendedRange) of 
  - 	true -> Bs1=lists:map(fun(B) -> extend_range(Range, B) end, Bs), 
  - 		{branch, {Range, {Len, Freq}}, Bs1};
  - 	false -> Bs1 = lists:map(fun(B) -> extend_range(ExtendedRange,B) end, Bs),
  - 		 {S, E} = hd(ExtendedRange),
  - 		 {branch, {ExtendedRange, {E-S+1, Freq}}, Bs1}
  -     end.
  +    {branch, {Range, {Len, Freq}}, leaf};
  +extend_range(Prev_Range, {branch, {Range, {Len, Freq}}, Bs}) ->
  +    ExtendedRange = lists:map(fun (R) -> combine_range(Prev_Range, R) end, Range),
  +    case overlapped_range(ExtendedRange) orelse
  +	   lists:subtract(ExtendedRange, Range) =/= ExtendedRange
  +	of
  +      true ->
  +	  Bs1 = lists:map(fun (B) -> extend_range(Range, B) end, Bs),
  +	  {branch, {Range, {Len, Freq}}, Bs1};
  +      false ->
  +	  Bs1 = lists:map(fun (B) -> extend_range(ExtendedRange, B) end, Bs),
  +	  {S, E} = hd(ExtendedRange),
  +	  {branch, {ExtendedRange, {E - S + 1, Freq}}, Bs1}
  +    end.
   
   overlapped_range(R) -> overlapped_range_1(lists:usort(R)).
   
  
positive.code: 	Other  -> erlang:error(io:format("Unhandled token:\n~p\n", [Other]))
      end.
  
  
  %% get the location of a token.
  token_loc(T) ->
        case T of 
  
negative.code:     
  trim_range(Range, {Len1, Len2}) ->
      lists:map(fun({S,E}) -> trim_range_1({S,E}, {Len1, Len2}) end, Range).
  trim_range_1(_Range={{File, StartLn, StartCol}, {File, EndLn, EndCol}}, {Len1, Len2}) ->
      S = {StartLn, StartCol},
      E = {EndLn, EndCol},
      Toks =tokenize_file(File, false),
      Toks1 = lists:dropwhile(fun(T) -> token_loc(T) =/=S end, Toks),
      Toks2 = lists:nthtail(Len1, Toks1),
      {StartLn1, StartCol1} = token_loc(hd(Toks2)),
      {Toks3, _Toks4} = lists:splitwith(fun(T) -> token_loc(T) =< E end, Toks1),
      LastTok = hd(lists:nthtail(Len2, lists:reverse(Toks3))),
      {L, C} = token_loc(LastTok),
      {EndLn1, EndCol1} = {L, C+token_len(LastTok)-1},
      {{File, StartLn1, StartCol1}, {File, EndLn1, EndCol1}}.
  
  token_len(T) ->
      V = token_val(T),
      token_len_1(V).
  
  token_len_1(V) when is_atom(V) ->
      length(atom_to_list(V));
  token_len_1(V) when is_integer(V) ->
      length(integer_to_list(V));
  token_len_1(V) when is_list(V)->
      length(V);
  token_len_1(V) when is_float(V) ->
      %% this is not what I want; but have not figure out how to do it.
      length(float_to_list(V)); 
  token_len_1(V) when is_binary(V) ->
      length(binary_to_list(V));
  token_len_1(V) -> erlang:error(io:format("Unhandled data type:\n~p\n", [V])).
         
  
  %% display the found-out clones to the user.
  display_clones1(Cs) ->
  