anchor.diff:      case var_sub_conflicts(CurVarSubsts, VarSubAcc) of
         true ->
   	    %% conflicting variable substitution.
  -	  case length(ClonePairAcc) >= Thresholds#threshold.min_len of
  +	  case clone_pair_above_min_size(ClonePairAcc, Thresholds) of
   	      true ->
   		  NewClonePairs = decompose_clone_pair_by_simi_score(
   				    lists:reverse(ClonePairAcc), Thresholds, Tabs),
  
positive.code: 		case Freq >= MinFreq of
  		  true ->
  			NewRanges = [F0(R) || R <- Ranges],
  			{NewRanges, {length(hd(NewRanges)), Freq}};
  		    _ -> []
  		end
  	end,
      NewCs=[F(C) || C <- Cs],
      %% ?debug("NewCs1:\n~p\n", [NewCs]),
      NewCs1=remove_short_clones(NewCs, MinToks,MinFreq),
      NewCs1.
    
  remove_short_clones(Cs, MinToks, MinFreq) ->
      F= fun({Rs, {Len, _Freq}}) ->
  
negative.code: 
  %% examine the result of anti-unifying a pair of expression sequences and 
  %% get the sub expression sequences pairs that are anti-unifiable.
  group_au_result([], _Thresholds)->
      [];
  group_au_result(AURes, Thresholds) ->
      %% here 'none' means the two expressions E1 an E2 do not anti-unify.
      {AUResList1,AUResList2} =
  	lists:splitwith(fun({_E1,_E2, S}) ->S/=none end, AURes),
      AUResList3 = case AUResList2 of
  		     [] -> [];
  		     [_|T] -> T
  		 end,
      case clone_pair_above_min_size(AUResList1, Thresholds) of
  	true ->
  	    [AUResList1]++group_au_result(AUResList3, Thresholds);
  	false ->
  	    group_au_result(AUResList3, Thresholds)
      end.
    
  
  clone_pair_above_min_size(CP, Thresholds) ->
      length(CP)>=Thresholds#threshold.min_len andalso
  	lists:sum([element(2, E1)||{E1,_E2, _S}<-CP])
  	>=Thresholds#threshold.min_toks.
  
  get_clone_pairs(AURes, Thresholds, Tabs) ->
      get_clone_pairs(AURes, Thresholds, Tabs, {[],[]},[]).
  
  get_clone_pairs([], Thresholds, Tabs, {_, ClonePairAcc}, Acc) ->
      case clone_pair_above_min_size(ClonePairAcc, Thresholds) of
  	true ->
  	    ClonePairs = decompose_clone_pair_by_simi_score(
  			   lists:reverse(ClonePairAcc), Thresholds, Tabs),
  	    ClonePairs ++ Acc;
  	false ->
  	    Acc
      end;
  get_clone_pairs([CurPair = {_E1, _E2, SubSt}| AURes], Thresholds, Tabs,
  		{VarSubAcc, ClonePairAcc}, Acc) ->
  