anchor.diff:  	    Res
       end.
      
  -num_of_new_vars(SubSt) ->
  -    length(lists:usort([{refac_prettypr:format(refac_misc:reset_attrs(E1)),
  -			 refac_prettypr:format(refac_misc:reset_attrs(E2))}
  -			||{E1,E2}<-SubSt, refac_syntax:type(E1)/=variable])).
   
   no_of_nodes(Nodes) when is_list(Nodes) ->
       lists:sum([no_of_nodes(N)||N<-Nodes]);
  
positive.code: 				      VarsToExport2)],
  	    %% EVs are variables from Exprs1 that need to be exported.
  	    NumOfNewVars = num_of_new_vars(SubSubst),
  	    [{{SubRange2, EVs, SubSubst}, NumOfNewVars}];
        	false ->
  	    []
      end.
  
  group_clone_pairs(ClonePairs, Thresholds) ->
      ClonePairs1=lists:keysort(2,ClonePairs),
      group_clone_pairs(ClonePairs1,Thresholds, 0,[],[]).
  
  group_clone_pairs([], _,_, TmpAcc, Acc) ->
      case TmpAcc of
  	[] -> lists:reverse(Acc);
  	_ -> lists:reverse([TmpAcc|Acc])
      end;
  group_clone_pairs([_ClonePairs={C,NumOfNewVars}|T], Thresholds, Sum, TmpAcc, Acc) ->
      MaxNewVars = Thresholds#threshold.max_new_vars,
      MinFreq= Thresholds#threshold.min_freq -1,
      NewSum = NumOfNewVars+Sum,
      case NewSum =< MaxNewVars of 
  	true ->
  	    group_clone_pairs(T, Thresholds, NewSum, [C|TmpAcc], Acc);
  	false ->
  	    case length(TmpAcc)>=MinFreq of 
  		true ->
  		    case NumOfNewVars=<MaxNewVars of
  			true ->
  			    group_clone_pairs(T, Thresholds, NumOfNewVars, [C],
  					      [lists:reverse(TmpAcc)|Acc]);
  			false ->
  			    group_clone_pairs(T, Thresholds, NumOfNewVars, [],
  					      [lists:reverse(TmpAcc)|Acc])
  		    end;
  		false ->
  		    case NumOfNewVars=<MaxNewVars of 
  			true ->
  			    group_clone_pairs(T, Thresholds, NumOfNewVars, [C], Acc);
  			false ->
  			    group_clone_pairs(T, Thresholds, NumOfNewVars, [], Acc)
  		    end
  	    end
      end.
  	    
  
  
      
  
negative.code: 	++ decompose_clone_pair_by_simi_score_3(ClonePairs2, Thresholds) 
  	++ Acc.
  
  
  decompose_clone_pair_by_simi_score_3(ClonePairs, Thresholds)->
      MinLen = Thresholds#threshold.min_len,
      SimiScoreThreshold = Thresholds#threshold.simi_score,
  