anchor.diff:  %%                                                                    %%
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   
  -start_hash_process() ->	
  +start_hash_process(FilesDeleted, FilesChanged) ->	
  +    ObsoleteFiles = FilesDeleted++FilesChanged,
       ExpHashTab =from_dets(expr_hash_tab, ?ExpHashTab),
       case file:read_file(?ExpSeqFile) of
   	{ok, Binary} ->
  -	   %% refac_io:format("Data:\n~p\n", [binary_to_term(Binary)]),
  -	    Data=binary_to_term(Binary);
  +	    Data=lists:reverse(binary_to_term(Binary)),
  +	    ?debug("Orignal data:\n~p\n", [Data1]),
  +	    NewData=
  +		[{{{File, F, A, I}, Toks, Loc, false}, HashValIndex}
  +		 ||{{{File, F, A, I}, Toks, Loc, _IsNew}, HashValIndex}<-Data,
  +		   not lists:member(File, ObsoleteFiles)],
  +	    ChangedData=[Elem||Elem={{{File, F, A, I}, Toks, Loc, _IsNew}, HashValIndex}<-Data,
  +			       lists:member(File, FilesChanged)],			  
  +	    spawn_link(fun()->hash_loop({1,ExpHashTab,{NewData, ChangedData}}) end);
   	_Res ->
  -	    %%refac_io:format("Res:\n~p\n", [Res]),
  -	    Data=[{{{'_','_','_','_'},0, {0,0}},'#'}]
  -	end,
  -    spawn_link(fun()->hash_loop({1,ExpHashTab,Data}) end).
  -
  +	    Data={[{{{'_','_','_','_'},0, {{0,0},0}, false},'#'}],[]},
  +	    spawn_link(fun()->hash_loop({1,ExpHashTab,Data}) end)	    
  +    end.
  +  
   stop_hash_process(Pid) ->
       Pid!stop.
   
  -insert_hash(Pid, {HashVal, Elem={{_M,_F, _A, _Index}, _NumofTok, _StartEndLoc}}) ->
  +insert_hash(Pid, {HashVal, Elem={_MFAI, _NumofToks, _Loc}}) ->
       Pid ! {add, {HashVal, Elem}}.
  +
  +update_hash(Pid, {{FileName, FunName, Arity}, StartLine})->
  +    Pid ! {quick_hash,{{FileName, FunName, Arity}, StartLine}}.
   
   insert_dummy_entry(Pid) ->
       Pid ! add_dummy.
   
  -hash_loop({Index, ExpHashTab, Data}) ->
  +hash_loop({Index, ExpHashTab, {NewData, OldData}}) ->
       receive
  -      {add, {Key, {{M, F, A, Index1}, NumOfToks,StartEndLoc}}} ->
  -	  case ets:lookup(ExpHashTab, Key) of
  -	    [{Key, I}] ->
  -		hash_loop({Index, ExpHashTab, [{{{M, F, A, Index1}, NumOfToks, StartEndLoc}, I}| Data]});
  -	      [] -> ets:insert(ExpHashTab, {Key, Index}),
  -		  hash_loop({Index + 1, ExpHashTab, [{{{M, F, A, Index1}, NumOfToks, StartEndLoc}, Index}| Data]})
  -	  end;
  -      add_dummy ->
  -	  hash_loop({Index, ExpHashTab, [{{{'_', '_', '_', '_'}, 0, {0,0}}, '#'}| Data]});
  -      {get_clone_candidates, From, Thresholds, Dir} ->
  -	    Cs = search_for_clones(Dir, lists:reverse(Data), Thresholds),
  +	{add, {Key, {{M, F, A, Index1}, NumOfToks,{StartEndLoc, StartLine}}}} ->
  +	    case ets:lookup(ExpHashTab, Key) of
  +		[{Key, I}] ->
  +		    Elem={{{M, F, A, Index1}, NumOfToks,{StartEndLoc, StartLine}, true}, I},
  +		    hash_loop({Index, ExpHashTab,{[Elem| NewData],OldData}});
  +		[] -> ets:insert(ExpHashTab, {Key, Index}),
  +		      Elem={{{M, F, A, Index1}, NumOfToks, {StartEndLoc, StartLine}, true}, Index},
  +		      hash_loop({Index + 1, ExpHashTab, {[Elem|NewData], OldData}})
  +	    end;
  +	{quick_hash,{{FileName, FunName, Arity}, StartLine}} ->
  +	    DataToAdd=[{{M,F,A, I}, NumOfToks, {StartEndLoc, StartLine},true}
  +		       ||{{M,F,A, I}, NumOfToks, {StartEndLoc, _}, _}<-Data1,
  +			 {M,F,A}=={FileName, FunName, Arity}],
  +	    hash_loop({Index, ExpHashTab, Data});    %% Fix this!
  +	add_dummy ->
  +	    DummyElem={{{'_', '_', '_', '_'}, 0, {{0,0},0}, false}, '#'},
  +	    hash_loop({Index, ExpHashTab, {[DummyElem|NewData], OldData}});
  +	{get_clone_candidates, From, Thresholds, Dir} ->
  +	    Cs = search_for_clones(Dir, lists:reverse(NewData), Thresholds),
   	    From ! {self(), Cs},
  -	    hash_loop({Index, ExpHashTab, Data});
  +	    hash_loop({Index, ExpHashTab, {NewData, OldData});
   	stop ->
   	    to_dets(ExpHashTab, ?ExpHashTab),
  -	    file:write_file(?ExpSeqFile, term_to_binary(lists:reverse(Data))),
  +	    file:write_file(?ExpSeqFile, term_to_binary(lists:reverse(NewData))),
   	    ok
       end.
   
  
positive.code: 	    SubRange2 = lists:sublist(Range2, StartIndex, Len),
  	    SubSubst = lists:append(lists:sublist(Subst, StartIndex, Len)),
  	    Exprs2 = get_expr_list(SubRange2, TmpASTTab),
  	    [{{FName, FunName, Arity, _}, _, _}| _] = SubRange2,
  	    VarTab = Tabs#tabs.var_tab,
  	    VarsToExport2 = get_vars_to_export(Exprs2, {FName, FunName, Arity}, VarTab),
  	    EVs = [E1 || {E1, E2} <- SubSubst, refac_syntax:type(E2) == variable,
  
negative.code: 			|| {[{S, E}| Ranges], Len, Freq} <- Cs,
  			   SubStr <- [lists:sublist(IndexStr, S, E - S + 1)]]),
      Cs2 = refac_code_search_utils:remove_sub_clones([{R, Len, Freq} || {R, {Len, Freq}} <- Cs1]),
      refac_io:format("Cs2:\n~p\n", [Cs2]),
      NewData = lists:append([F(Elem) || Elem <- Data]),
      refac_io:format("Cs from suffixtree:\n~p\n",[NewData]),
      get_clones_in_ranges([{R, {Len, Freq}} || {R, Len, Freq} <- Cs2],
  			 NewData, MinLen, MinToks, MinFreq).
     
  