anchor.diff:  	      end
         end,
       R = refac_syntax_lib:fold(F, [], Tree),
  -    lists:member(true, R). 
  -		      
  -
  -
  -do_transformation({AnnAST, Info},{TargetAnnAST, Info1}, {ModName, FunName,Arity}, TargetModName) ->
  -    Forms = refac_syntax:form_list_elements(AnnAST),    
  -    FunToBeMoved = hd([F || F<-Forms, not(is_not_the_fun(F, {ModName, FunName, Arity}))]),
  +    lists:member(true, R).
  +
  +do_transformation({AnnAST, Info}, {TargetAnnAST, Info1}, {ModName, FunName, Arity}, TargetModName) ->
  +    Forms = refac_syntax:form_list_elements(AnnAST),
  +    FunToBeMoved = hd([F || F <- Forms, not is_not_the_fun(F, {ModName, FunName, Arity})]),
       FunsToBeExported = local_funs_to_be_exported(FunToBeMoved, {ModName, FunName, Arity}, Info),
       InScopeFunsInTargetMod = refac_util:inscope_funs(Info1),
  -    FunToBeMoved1 = transform_fun(FunToBeMoved,{ModName, FunName, Arity}, TargetModName, InScopeFunsInTargetMod),
  +    FunToBeMoved1 = transform_fun(FunToBeMoved, {ModName, FunName, Arity}, TargetModName, InScopeFunsInTargetMod),
       {AnnAST1, FunIsUsed} = do_remove_fun(AnnAST, {ModName, FunName, Arity}, FunsToBeExported, TargetModName),
       IsExported = refac_util:is_exported({FunName, Arity}, Info),
       Export = FunIsUsed or IsExported,
       TargetAnnAST1 = do_add_fun({TargetAnnAST, Info1}, FunToBeMoved1, {ModName, FunName, Arity}, TargetModName, Export),
       {AnnAST1, TargetAnnAST1}.
   
  -
   %%==============================================================================
   %% Functions defined in the current module, but used by the function to be moved.
   %%===============================================================================
   local_funs_to_be_exported(Node, {ModName, FunName, Arity}, Info) ->
       Funs = fun (T, S) ->
  -		case refac_syntax:type(T) of
  -		  application ->
  -			Operator = refac_syntax:application_operator(T),
  -			case application_info(T) of 
  -			    {{none, F}, A} ->
  -				case get_fun_def_info(Operator) of 
  -				    {ModName, F, A, _P} when {F,A} =/= {FunName, Arity}
  -							     -> ordsets:add_element({F, A}, S);
  -				    _ -> S
  -				end;
  -			    _ -> S
  -			end;
  -		    _ -> S
  -		end
  +		   case refac_syntax:type(T) of
  +		     application ->
  +			 Operator = refac_syntax:application_operator(T),
  +			 case application_info(T) of
  +			   {{none, F}, A} ->
  +			       case get_fun_def_info(Operator) of
  +				 {ModName, F, A, _P} when {F, A} =/= {FunName, Arity} ->
  +				     ordsets:add_element({F, A}, S);
  +				 _ -> S
  +			       end;
  +			   _ -> S
  +			 end;
  +		     _ -> S
  +		   end
   	   end,
       Fs = refac_syntax_lib:fold(Funs, ordsets:new(), Node),
  -    [F||F<-Fs, not(refac_util:is_exported(F, Info))].
  +    [F || F <- Fs, not refac_util:is_exported(F, Info)].
   
   
   %%======================================================================================
  
positive.code: 		  _ -> {Node, false}
   	      end;
          _  -> {Node, false}
      end.   
  
  
  %%=========================================================================
  
negative.code:     {refac_syntax:copy_attrs(AnnAST, refac_syntax:form_list(NewForms)), Fun_is_Used}.
  
  %%=======================================================================
  %% Add the function to the target module.
  %%=======================================================================
  do_add_fun({TargetAnnAST, Info}, FunToBeMoved, {ModName, FunName, Arity}, TargetModName, ToBeExported) ->
      Forms = refac_syntax:form_list_elements(TargetAnnAST),
      FunWithSameName = [F || F <- Forms, not is_not_the_fun(F, {list_to_atom(TargetModName), FunName, Arity})],
      NewFun = case FunWithSameName of
  	       [] -> [FunToBeMoved];
  	       _ -> []
  	     end,
      Forms1 = [process_forms_in_target_module(Form, {ModName, FunName, Arity}, TargetModName) || Form <- Forms],
      IsExported = refac_util:is_exported({FunName, Arity}, Info),
      NewForms = case ToBeExported andalso not IsExported of
  		 false -> Forms1 ++ NewFun;
  		 true -> Export = make_export([{FunName, Arity}]),
  			 {Forms11, Forms12} = lists:splitwith(fun (F) -> refac_syntax:type(F) == attribute
  									   orelse refac_syntax:type(F) == comment
  							      end, Forms1),
  			 Forms11 ++ Export ++ Forms12 ++ NewFun
  	       end,
      refac_syntax:copy_attrs(TargetAnnAST, refac_syntax:form_list(NewForms)).
  
  