anchor.diff:  %%--------------------------------------------------------------------   
   start_evaluation({DefFiles,Scope},Info,Pid,RulesFun,Expression,NSteps,TypedF,Timeout) ->
   	    if Pid /= "" ->
  -		    	Steps = get_temp_info_steps(Pid),
  -                        NRefacsDone = get_temp_info_nSteps(Pid),
  -		    	Body = lists:nth(NRefacsDone+1,Steps),
  -		            NewBody = evaluate(Pid,Body,{DefFiles,Scope},Info,RulesFun,false,NSteps,TypedF,0,Steps),
  -                            if TypedF == false ->
  -					    NSteps_Int = list_to_integer(NSteps),
  -				            if   length(Steps) > NSteps_Int + NRefacsDone -> Change = true;
  -				                 true -> Change = ?PP(NewBody) /= ?PP(Body)
  -				            end;
  -                               true -> if length(Steps) - 1 > NRefacsDone -> Change = true;
  -                                          true -> Change = ?PP(NewBody) /= ?PP(Body)
  -                                       end
  -                            end,
  -                            if
  -				    Change ->
  -                                             PidEvaluation = spawn(eval, try_evaluate, [Pid,Body,{DefFiles,Scope},Info,RulesFun,true,NSteps,TypedF,0,Steps,self()]),
  -                                             case Timeout of
  -                                                  0 -> timeout_manager(PidEvaluation,Body,1000);
  -                                                  _ -> timeout_manager(PidEvaluation,Body,Timeout)
  -                                             end;
  -				    true ->
  -                                              {error,"No evaluation done"}
  -                            end;
  -               true ->  Body = ?TO_AST(Expression),
  +		            continue_evaluation(DefFiles, Scope, Info, Pid,
  +                                                RulesFun, NSteps, TypedF,
  +		                                Timeout);
  +               true ->
  +		    Body = ?TO_AST(Expression),
                          Change = ?PP(evaluate("",Body,{DefFiles,Scope},Info,RulesFun,false,NSteps,TypedF,0,[Body])) /= Expression,
                          if
   			       Change ->
  -                                        PidEvaluation = spawn(eval, try_evaluate, [Pid,Body,{DefFiles,Scope},Info,RulesFun,true,NSteps,TypedF,0,[Body],self()]),
  -                                        case Timeout of
  -                                        	0 -> timeout_manager(PidEvaluation,Body,1000);
  -                                                _ -> timeout_manager(PidEvaluation,Body,Timeout)
  -                                        end;
  +			                call_try_evaluate(DefFiles,Scope,Info,Pid,RulesFun,NSteps,TypedF,Timeout,[Body],0,Body);
   				true -> 
                             		{error,"No evaluation done"}   
          	    		end
               end.
   
  -try_evaluate(Pid,Body,{File,Scope},Info,RulesFun,true,NSteps,TypedF,NRefacsDone,Steps,MainPid) ->
  -            Result = evaluate(Pid,Body,{File,Scope},Info,RulesFun,true,NSteps,TypedF,NRefacsDone,Steps),
  +call_try_evaluate(DefFiles, Scope, Info, Pid, RulesFun, NSteps, TypedF,
  +	          Timeout, Steps, NRefacsDone, Body) ->
  +    call_try_evaluate(DefFiles, Scope, Info, Pid, RulesFun, NSteps, TypedF,
  +	          Timeout, Steps, NRefacsDone, Body,"").
  +
  +call_try_evaluate(DefFiles, Scope, Info, Pid, RulesFun, NSteps, TypedF,
  +	          Timeout, Steps, NRefacsDone, Body,IText) ->
  +    PidEvaluation = spawn(eval, try_evaluate, [Pid,Body,{DefFiles,Scope},Info,RulesFun,true,NSteps,TypedF,NRefacsDone,Steps,self(),IText]),
  +    case Timeout of
  +	0 -> timeout_manager(PidEvaluation,Body,1000);
  +        _ -> timeout_manager(PidEvaluation,Body,Timeout)
  +    end.
  +
  +continue_evaluation(DefFiles, Scope, Info, Pid, RulesFun, NSteps,
  +                    TypedF, Timeout) ->
  +    Steps = get_temp_info_steps(Pid),
  +    NRefacsDone = get_temp_info_nSteps(Pid),
  +    Body = lists:nth(NRefacsDone + 1,Steps),
  +		           
  +    Change = if TypedF == false ->
  +		     NSteps_Int = list_to_integer(NSteps),
  +		     if
  +			NSteps_Int < 0 andalso NRefacsDone /= 0 -> go_back_steps(Pid,NSteps_Int,true),ok;
  +			NSteps_Int < 0 -> false;
  +		        length(Steps) - 1 > NRefacsDone andalso NSteps_Int > 0 -> true;
  +			true ->
  +				   checkForTransformation(DefFiles,Scope,Info,Pid,RulesFun,NSteps,TypedF,
  +                                                          Steps,NRefacsDone,Body)
  +                     end;
  +                true -> if 
  +			   length(Steps) - 1 > NRefacsDone -> true;
  +                           true -> checkForTransformation(DefFiles,Scope,Info,Pid,RulesFun,NSteps,TypedF,
  +                                                          Steps,NRefacsDone,Body)
  +                        end
  +             end,
  +    if
  +	    Change ->
  +                     evaluate_if_necessary(DefFiles, Scope, Info, Pid, RulesFun, NSteps,
  +                                           TypedF, Timeout, Steps, NRefacsDone, Body, []);
  +	    Change == ok -> {ok,[]};
  +	    true ->
  +                      {error,"No evaluation done"}
  +    end.
  +
  +evaluate_if_necessary(DefFiles, Scope, Info, Pid, RulesFun, NSteps, TypedF,
  +                      Timeout, Steps, NRefacsDone, Body, ChangedSteps) ->
  +    if
  +	TypedF andalso length(Steps) - 1 > NRefacsDone ->
  +	       NRefacsDoneI = NRefacsDone + 1,
  +	       NewBody = lists:nth(NRefacsDoneI + 1,Steps),
  +	       NewChangedSteps = ChangedSteps ++ [NewBody],
  +	       evaluate_if_necessary(DefFiles, Scope, Info, Pid, RulesFun, NSteps, TypedF, Timeout, Steps, NRefacsDoneI, NewBody, NewChangedSteps);
  +	TypedF -> call_try_evaluate(DefFiles, Scope, Info, Pid, RulesFun,
  +		                       NSteps, TypedF, Timeout, Steps,
  +			               NRefacsDone, Body,get_text(ChangedSteps));
  +	true ->
  +		     NSteps_Int = list_to_integer(NSteps),
  +	   if
  +		     NSteps_Int == 0 ->
  +		     evaluation_ended(true,NRefacsDone,Pid, Body,Steps,get_text(ChangedSteps)),
  +		     {ok,[]};
  +			   length(Steps) - 1 > NRefacsDone andalso NSteps_Int > 0 ->
  +		     NewNSteps_Int = NSteps_Int - 1,
  +		     NRefacsDoneI = NRefacsDone + 1,
  +		     NewBody = lists:nth(NRefacsDoneI + 1,Steps),
  +		     NewChangedSteps = ChangedSteps ++ [NewBody],
  +		         evaluate_if_necessary(DefFiles, Scope, Info, Pid, RulesFun, integer_to_list(NewNSteps_Int), TypedF, Timeout, Steps, NRefacsDoneI, NewBody, NewChangedSteps);
  +			       true ->
  +		             call_try_evaluate(DefFiles, Scope, Info, Pid, RulesFun,
  +		                           NSteps, TypedF, Timeout, Steps,
  +			                   NRefacsDone, Body,get_text(ChangedSteps))
  +		     end
  +    end.
  +
  +checkForTransformation(DefFiles, Scope, Info, Pid, RulesFun, NSteps, TypedF, Steps,
  +                       NRefacsDone, Body) ->
  +    NewBody = evaluate(Pid,Body,{DefFiles,Scope},Info,RulesFun,false,NSteps,TypedF,NRefacsDone,Steps),
  +    ?PP(NewBody) /= ?PP(Body).
  +
  +try_evaluate(Pid,Body,{File,Scope},Info,RulesFun,true,NSteps,TypedF,NRefacsDone,Steps,MainPid,IText) ->
  +            Result = evaluate(Pid,Body,{File,Scope},Info,RulesFun,true,NSteps,TypedF,NRefacsDone,Steps,IText),
   	    MainPid ! {result, Result}.
   
   timeout_manager(Pid,Node,TimeOut) -> 
  
positive.code: -module(eval).
  -export([start_evaluation/8,keep_temp_info/3,try_evaluate/11]).
  
  %% Include files
  -include_lib("wrangler/include/wrangler.hrl").   
  
negative.code: %%--------------------------------------------------------------------
  evaluation_ended(Transform,NRefacsDone,Pid,NewBody,Steps,Text) -> 
                                  if Transform ->
  		                                if Pid /= "" ->  
  							OldText = get_temp_info_text(Pid),	  
  				                        Pid ! {refactoring_finished,NRefacsDone,Steps,OldText ++ Text},
                                                          write_result(Pid, NewBody),
  		                                        NewBody;
  		                                   true -> 
  		                                           write_result(Pid, NewBody)
  		                                end;
  