anchor.diff:  %% minimal number of tokens.
   -define(DEFAULT_MIN_CLONE_LEN, 20).
   
  -%% minimal number of duplication times.
  +%% minimal number of  duplication times.
   -define(DEFAULT_MIN_CLONE_MEMBER, 1).
   
   
  -%%-define(DEBUG, true).
  +-define(DEBUG, true).
   
   -ifdef(DEBUG).
   -define(debug(__String, __Args), io:format(__String, __Args)).
  --else.
  +-else. 
   -define(debug(__String, __Args), ok).
   -endif.
  +
  +start_suffix_tree_clone_detector() ->
  +    SuffixTreeExec = filename:join(?WRANGLER_DIR, "bin/suffixtree"),
  +    start(SuffixTreeExec).
  +
  +start(ExtPrg) ->
  +    process_flag(trap_exit, true),
  +    spawn_link(?MODULE, init, [ExtPrg]).
  +
  +stop_suffix_tree_clone_detector() ->
  +    ?MODULE ! stop.
  +
  +
  +get_clones_by_suffix_tree(FileNames,MinLength, MinClones) ->
  +    %% tokenize Erlang source files and concat the tokens into a single list.
  +    {Toks, ProcessedToks} = tokenize(FileNames),
  +    OutFileName = filename:join(?WRANGLER_DIR, "bin/wrangler_suffix_tree"),  %%Qn: Is this the proper place?
  +    file:write_file(OutFileName, ProcessedToks), 
  +    case catch call_port({get, MinLength, MinClones, OutFileName}) of
  +	{ok, _Res} ->
  +	    ?debug("The Initial clones is calculated by the C suffixtree implementation.\n", []),
  + 	    {ok, [Cs]} = file:consult(OutFileName),
  +   	    {Toks, Cs};
  + 	_-> 
  +	    ?debug("The Initial clones is calculated by the Erlang suffixtree implementation.\n", []),
  +	    Tree = suffix_tree(alphabet() ++ "&", ProcessedToks ++ "&"),
  + 	    Cs = lists:flatten(lists:map(fun (B) ->
  + 						 collect_clones(MinLength, MinClones, B)
  + 					 end,
  + 					 Tree)),
  + 	    {Toks, Cs}
  +     end.
  +
  +call_port(Msg) ->
  +    ?MODULE ! {call, self(), Msg},
  +    receive
  +    Result ->
  +        Result
  +    end.
  +
  +init(ExtPrg) ->
  +    register(?MODULE, self()),
  +    process_flag(trap_exit, true),
  +    Port = open_port({spawn, ExtPrg}, [{packet, 2}, binary, exit_status]),
  +    ?debug("Port:~p\n", [Port]),
  +    loop(Port).
  +
  +loop(Port) ->
  +    receive
  +    {call, Caller, Msg} ->
  +	    ?debug("Calling port with ~p~n", [Msg]),
  +	    erlang:port_command(Port, term_to_binary(Msg)),
  +	    receive
  +		{Port, {data, Data}} ->
  +		    Caller ! binary_to_term(Data);
  +		{Port, {exit_status, Status}} when Status > 128 ->
  +		    ?debug("Port terminated with signal: ~p~n", [Status-128]),
  +		    exit({port_terminated, Status});
  +		{Port, {exit_status, Status}} ->
  +		    ?debug("Port terminated with status: ~p~n", [Status]),
  +		    exit({port_terminated, Status});
  +		{'EXIT', Port, Reason} ->
  +		    exit(Reason)
  +	    end,
  +	    loop(Port);
  +    stop ->
  +        erlang:port_close(Port),
  +        exit(normal)
  +    end.
  +
  + 
   
   %% ==================================================================================
   %% @doc Find duplicated code in a Erlang source files.
  
positive.code: 
  duplicated_code(DirFileList, MinLength1, MinClones1) ->
      io:format("\nCMD: ~p:duplicated_code(~p,~p,~p).\n", [?MODULE, DirFileList, MinLength1, MinClones1]),
      {Cs5, FileNames} = duplicated_code_detection(DirFileList, MinClones1, MinLength1),
      ?debug("Filtering out sub-clones.\n", []),
      Cs6 = remove_sub_clones(Cs5),
      case length(FileNames) of
         1 -> display_clones(Cs6);
         _ -> display_clones1(Cs6)
       end,
      {ok, "Duplicated code detection finished."}.
  
  -spec(duplicated_code_1/3::(dir(), [integer()], [integer()]) ->
  
negative.code: %% Construction of suffix tree.
  suffix_tree(Alpha, T) -> 
       Tree = suffix_tree_1(Alpha, length(T),suffixes(T)),
      post_process_suffix_tree(Tree).
    
  
  suffix_tree_1(_Alpha, _Len, [[]]) -> leaf;
  