anchor.diff:  		true ->
   		    case Str22 of 
   			"" ->[{NewRanges1, {Len1, NewFreq}}];
  -			_ ->   [{NewRanges1, {Len1, NewFreq}} | split_a_clone({RemainedRanges, {Len, F}}, Str22, MinLen,MinFreq)]
  +			_ -> [{NewRanges1, {Len1, NewFreq}} | 
  +			      split_a_clone({RemainedRanges, {Len, F}}, Str22, MinLen,MinFreq)]
   		    end;
  +		false when Str22==""->
  +		    [];
   		false ->
  -		    case Str22 of 
  -			"" ->
  -			    [];
  -			_ -> 
  -			    split_a_clone({RemainedRanges, {Len, F}}, Str22, MinLen,MinFreq)
  -		    end
  +		    split_a_clone({RemainedRanges, {Len, F}}, Str22, MinLen,MinFreq)
   	    end;
  -	false ->
  -	    case Str22 of 
  -		"" ->
  -		    [];
  -		_ -> 
  -		    split_a_clone({RemainedRanges, {Len, F}}, Str22, MinLen,MinFreq)
  -	    end
  +	false when Str22==""->
  +	    [];
  +	false->split_a_clone({RemainedRanges, {Len, F}}, Str22, MinLen,MinFreq)
       end.
     
   remove_overlapped_ranges(Rs) ->
  
positive.code: 
  hash_loop({Index, ExpHashTab, Data}) ->
      receive
        {add, {Key, {{M, F, A, Index1}, NumOfToks}}} ->
  	  case ets:lookup(ExpHashTab, Key) of
  	    [{Key, I}] ->
  		hash_loop({Index, ExpHashTab, [{{{M, F, A, Index1}, NumOfToks}, I}| Data]});
  	    [] -> ets:insert(ExpHashTab, {Key, Index}),
  		  hash_loop({Index + 1, ExpHashTab, [{{{M, F, A, Index1}, NumOfToks}, Index}| Data]})
  	  end;
        add_dummy ->
  	  hash_loop({Index, ExpHashTab, [{{{'_', '_', '_', '_'}, 0}, '#'}| Data]});
        {get_clone_candidates, From, MinLen, MinToks, MinFreq, Dir} ->
  	    Cs = search_for_clones(Dir, lists:reverse(Data), MinLen, MinToks, MinFreq),
  	    From ! {self(), Cs},
  	    hash_loop({Index, ExpHashTab, Data});
  	stop ->
  	    to_dets(ExpHashTab, ?ExpHashTab),
  	    file:write_file(?ExpSeqFile, term_to_binary(Data)),
  	    ok
      end.
  
  
negative.code: %% for files, use MD5; for functions, a function has to be parsed and prettyprinted before
  %% calculating its MD5 value.
  
  generalise_and_hash_ast(Files, Threshold, Tabs, ASTPid, SearchPaths, TabWidth) ->	     
     %% refac_io:format("\nLists:~p\n", [ets:tab2list(Tabs#tabs.file_hash_tab)]),
      lists:foreach(fun(File) ->
  			  NewCheckSum=refac_misc:filehash(File),
  			  case ets:lookup(Tabs#tabs.file_hash_tab, File) of
  			      [{File, NewCheckSum}]->
  				  refac_io:format("\nFile Not changed\n"),
  				  ok;
  			      [{File, _NewCheckSum1}]->
  				  refac_io:format("\n File changed\n"),
  				  ets:insert(Tabs#tabs.file_hash_tab, {File, NewCheckSum}),
  				  generalise_and_hash_ast_1(File,Threshold, Tabs, 
  							    ASTPid, false, SearchPaths, TabWidth);
  			      [] ->
  				  refac_io:format("New file\n"),
  				  ets:insert(Tabs#tabs.file_hash_tab, {File, NewCheckSum}),
  				  generalise_and_hash_ast_1(File,Threshold, Tabs, 
  							    ASTPid, true, SearchPaths, TabWidth)
  			  end
  		  end, Files).
  
  
  generalise_and_hash_ast_1(FName, Threshold, Tabs, ASTPid, IsNewFile, SearchPaths, TabWidth) ->
      Fun = fun (Form) ->
  		  case refac_syntax:type(Form) of
  		    function ->
  			FunName = refac_syntax:atom_value(refac_syntax:function_name(Form)),
  			Arity = refac_syntax:function_arity(Form),
  			MinLen = Threshold#threshold.min_len,
  			HashVal = erlang:md5(refac_prettypr:format(Form)),
  			case IsNewFile of
  			    true -> 
  				generalise_and_hash_a_form(FName, Form, FunName, Arity, HashVal, MinLen, Tabs, ASTPid);
  			    false ->
  				case ets:lookup(Tabs#tabs.var_tab, {FName, FunName, Arity}) of
  				    [{{FName, FunName, Arity}, HashVal, _VarInfo}] ->
  					ok;   %% this function has not been syntacaically changed.
  				    _ -> 
  					generalise_and_hash_a_form(FName, Form, FunName, Arity, HashVal, MinLen, Tabs, ASTPid)
  				end
  			end;
  		      _ -> ok
  		  end
  	  end,
  