anchor.diff:      case Freq >= Thresholds#threshold.min_freq of
         true ->
   	  Exprs = get_expr_list(Range, TmpASTTab),
  -	  [{{FName, FunName, Arity, _}, _, _}| _] = Range,
  +	  [{{FName, FunName, Arity, _}, _, _,_}| _] = Range,
   	  VarTab = Tabs#tabs.var_tab,
   	  VarsToExport = get_vars_to_export(Exprs, {FName, FunName, Arity}, VarTab),
   	  {Ranges, ExportVars, SubSt} = lists:unzip3(Res),
  
positive.code: 		refac_misc:get_var_exports(Exp) == [] 
      end.
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %%                                                                    %%
  %% Store the AST representation of expression statements in ETS table %%
  %%                                                                    %%
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  start_ast_process(ASTTab) ->
      HashPid = start_hash_process(),
      spawn_link(fun()-> 
  		       ast_loop(ASTTab, {'_','_','_', 1, HashPid})
  	       end).
  
  stop_ast_process(Pid)->
      Pid ! stop.
  
  insert_to_ast_tab(Pid, {{M, F, A}, ExprASTs}) ->
      Pid ! {add, {{M, F, A}, ExprASTs}}.
  
  get_clone_candidates(Pid, Thresholds, Dir) ->
      Pid ! {get_clone_candidates, self(), Thresholds, Dir},
      receive
        {Pid, Cs} ->
  	  Cs
      end.
  
  ast_loop(ASTTab, {CurM, CurF, CurA, Index, HashPid}) ->
      receive
        {add, {{M, F, A}, ExprASTs}} ->
  	  case {M, F, A} == {CurM, CurF, CurA} of
  	    true ->
  		Len = length(ExprASTs),
  		ExprASTsWithIndex = lists:zip(ExprASTs, lists:seq(0, Len - 1)),
  		[begin
  		     NoOfToks = no_of_tokens(E),
  		     ets:insert(ASTTab, {{M, F, A, Index + I}, E}),   %%TODO: WHAT ELSE INFO CAN BE REMOVED?
  		     E1 = do_generalise(E),
  		     HashVal = erlang:md5(refac_prettypr:format(E1)),
  		     StartEndLoc=refac_misc:get_start_end_loc(E),
  		     insert_hash(HashPid, {HashVal, {{M, F, A, Index + I}, NoOfToks, StartEndLoc}})
  		 end || {E, I} <- ExprASTsWithIndex],
  		  insert_dummy_entry(HashPid),
  		  ast_loop(ASTTab, {CurM, CurF, CurA, Index + Len, HashPid});
  	    false ->
  		Len = length(ExprASTs),
  		ExprASTsWithIndex = lists:zip(ExprASTs, lists:seq(1, Len)),
  		[begin
  		     NoOfToks = no_of_tokens(E),
  		     ets:insert(ASTTab, {{M, F, A, I}, E}),
  		     E1 = do_generalise(E),
  		     HashVal = erlang:md5(refac_prettypr:format(E1)),
  		     StartEndLoc=refac_misc:get_start_end_loc(E),
  		     insert_hash(HashPid, {HashVal, {{M, F, A, I}, NoOfToks, StartEndLoc}})
  		 end || {E, I} <- ExprASTsWithIndex],
  		  insert_dummy_entry(HashPid),
  		  ast_loop(ASTTab, {M, F, A, Len + 1, HashPid})
  	  end;
        {get_clone_candidates, From, Thresholds, Dir} ->
  	    Cs = get_clone_candidates(HashPid, Thresholds, Dir),
  	    From ! {self(), Cs},
  	    ast_loop(ASTTab, {CurM, CurF, CurA, Index, HashPid});
        stop ->
  	    stop_hash_process(HashPid),
  	    ok;
  	_Msg -> 
  	    ?wrangler_io("Unexpected message:\n~p\n",[_Msg]),
  	    ok
      end.
  	    
      
  do_generalise(Node) ->
      F0 =fun (T, _Others) ->
  		case variable_replaceable(T) of
  		    true ->
  			{refac_syntax:variable('Var'), true};
  		    false -> {T, false}
  		end
  	end,
      element(1, ast_traverse_api:stop_tdTP(F0, Node, [])).
      
  	
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %%                                                                    %%
  
negative.code: 
  -include("../include/wrangler.hrl").
  
  %% default threshold values.
  -define(DefaultSimiScore, 0.8).
  -define(DEFAULT_LEN, 5).
  -define(DEFAULT_TOKS, 20).
  -define(DEFAULT_FREQ, 2).
  -define(DEFAULT_SIMI_SCORE, 0.8).
  -define(DEFAULT_NEW_VARS, 5).
  
  
  %% record to store the threshold values.
  -record(threshold, 
  	{min_len = ?DEFAULT_LEN,
  	 min_freq= ?DEFAULT_FREQ,
  