anchor.diff:                      case ERs of
                           [{refactoring, Refac, Question}|Cs] ->
                               NewState=update_state(State, PrevResult),
  -                            From ! {self(), {ok, {question, Question, Refac}}, self()},
  -                            question_refac_loop(Parent, NewState#state{cmds={question, Cs}});
  +                            From ! {self(), {ok, {interactive, Question, Refac}}, self()},
  +                            interactive_refac_loop(Parent, NewState#state{cmds={interactive, Cs}});
                           [] ->
                               ModifiedSoFar =update_modified_files(PrevResult,Changes),
                               From ! {get_next_command, Parent, [ok, sets:to_list(ModifiedSoFar)]}
                       end
               end;
  -        {'EXIT', ChildrenPid, Reason} ->
  -            refac_io:format("~p died with:~p~n", [ChildrenPid, Reason]),
  -            cmd_server_loop(Parent, State);
  -        Msg ->
  -            refac_io:format("Unexpected message in question_refac_loop: ~p.\n", [Msg]),
  -            error(format_msg("Unexpected message in question_refac_loop: ~p.\n", Msg))
  -    end.
  -
  -repeat_question_refac_loop(Parent, State=#state{cmds={question, ER0s},changed_files=Changes}) ->
  +        Msg ->
  +            error(format_msg("Unexpected message in interactive_refac_loop: ~p.\n", Msg))
  +    end.
  +
  +repeat_interactive_refac_loop(Parent, State=#state{cmds={repeat_interactive, ER}}) 
  +  when not is_list(ER) ->
  +    repeat_interactive_refac_loop(Parent, State#state{cmds={repeat_interactive, 
  +                                                            make_list(ER)}});
  +repeat_interactive_refac_loop(Parent, State=#state{cmds={repeat_interactive, ER0s},
  +                                                   changed_files=Changes}) ->
       receive 
           {From, get_next_command, PrevResult} ->
               ERs = generate_cmds(ER0s,State#state.name_tracker_pid),
               case ERs of
  -                [{refactoring, Refac, Question}|_Cs] ->
  +                [] -> 
  +                    ModifiedSoFar =update_modified_files(PrevResult,Changes),
  +                    From !{get_next_command, Parent, [ok, sets:to_list(ModifiedSoFar)]};
  +                _ ->
                       case PrevResult of
                           none ->
  -                            From ! {get_next_command, Parent, [ok, Changes]};
  +                            case ERs of 
  +                                [_C] ->
  +                                    From ! {get_next_command, Parent, [ok, sets:to_list(Changes)]};
  +                                [_C|Cs] ->
  +                                    From !{get_next_command, self(), [ok, []]},
  +                                    repeat_interactive_refac_loop(Parent, State#state{cmds={repeat_interactive, Cs}})
  +                            end;
  +                        [error, _Reason] ->
  +                            case State#state.atomic of 
  +                                true ->
  +                                    From ! {get_next_command, Parent, PrevResult};
  +                                false->
  +                                    [{refactoring, Refac, Question}|_Cs]=ERs,
  +                                    From ! {self(), {ok, {repeat_interactive, Question, Refac}}, self()},
  +                                    repeat_interactive_refac_loop(Parent,State)
  +                            end;
                           [ok, _Modified] ->
                               NewState=update_state(State, PrevResult),
  -                            From ! {self(), {ok, {repeat_question, Question, Refac}}, self()},
  -                            repeat_question_refac_loop(Parent, NewState#state{cmds=ERs});
  -                        [error, _Reason] ->
  -                            Parent! {get_next_command, Parent, PrevResult}
  -                    end;
  -                [] ->
  -                    From ! {get_next_command, Parent, [ok, Changes]}
  -            end;
  -        {'EXIT', ChildrenPid, Reason} ->
  -            refac_io:format("~p died with:~p~n", [ChildrenPid, Reason]),
  -            cmd_server_loop(Parent, State);
  -        Msg ->
  -            refac_io:format("Unexpected message in repeat_question_refac_loop: ~p.\n", [Msg]),
  -            error(format_msg("Unexpected message in repeat_question_refac_loop: ~p.\n", Msg))
  -    end.
  -
  -while_refac_loop(Parent, State=#state{cmds={while, Cond, CRs}, 
  +                            [{refactoring, Refac, Question}|_Cs]=ERs,
  +                            From ! {self(), {ok, {repeat_interactive, Question, Refac}}, self()},
  +                            repeat_interactive_refac_loop(Parent, NewState)
  +                    end
  +            end;
  +        Msg ->
  +            error(format_msg("Unexpected message in repeat_interactive_refac_loop: ~p.\n", Msg))
  +    end.
  +
  +while_refac_loop(Parent, State=#state{cmds={while, Cond, CmdGen},
                                         changed_files=Changes}) ->
       receive
  -    {From, get_next_command, _PrevResult} ->
  -        case Cond() of
  -            true ->
  -                CurrentPid = self(),
  -                CR1s = make_list(CRs),
  -                Pid = spawn_link(fun()->
  -                                         cmd_server_loop(CurrentPid, State#state{cmds=CR1s})
  -                                 end),
  -                process_flag(trap_exit, true),
  -                From ! {get_next_command, Pid, [ok, []]},
  -                while_refac_loop(Parent, State);
  -            false ->
  -                From !{get_next_command, Parent, [ok, Changes]}
  -        end;
  +        {From, get_next_command, PrevResult} ->
  +            case PrevResult of 
  +                [error, Reason] when State#state.atomic ->
  +                    From ! {get_next_command, Parent, [error, Reason]};
  +                _ ->
  +                    ModifiedSoFar = update_modified_files(PrevResult,Changes),
  +                    case Cond() of
  +                        true ->
  +                            Res = generate_cmds(CmdGen,State#state.name_tracker_pid),
  +                            case Res of 
  +                                [] ->
  +                                    From !{get_next_command, Parent, [ok, sets:to_list(ModifiedSoFar)]};
  +                                [{refactoring, Refac, _Question}|Cs] ->
  +                                    From ! {self(), {ok, {refactoring, Refac}}, self()},
  +                                    wrangler_io:format("Cs:\n~p\n", [Cs]),
  +                                    while_refac_loop(Parent, 
  +                                                     State#state{cmds={while, Cond, Cs},
  +                                                                 changed_files=ModifiedSoFar})
  +                            end;
  +                        false ->
  +                            From !{get_next_command, Parent, [ok, sets:to_list(ModifiedSoFar)]}
  +                    end
  +            end;
           {'EXIT', ChildrenPid, Reason} ->
  -            refac_io:format("~p died with:~p~n", [ChildrenPid, Reason]),
  +            wrangler_io:format("~p died with:~p~n", [ChildrenPid, Reason]),
               while_refac_loop(Parent, State);
           Msg ->
               error(format_msg("Unexpected message in while_refac_loop:~p\n", Msg))    
  
positive.code: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %% This function takes the first command generator in the list, expands it
  %% and appends the result to the front of the list of cmd generators.
  generate_cmds(Cmd, NameTrackerPid) when not is_list(Cmd) ->
      generate_cmds([Cmd], NameTrackerPid);
  generate_cmds([], _) -> [];
  generate_cmds([Cmd|Cmds], NameTrackerPid) ->
      refac_io:format("Cmd:\n~p\n",[Cmd]), 
      Cmd1 = generate_a_cmd(Cmd, NameTrackerPid),
      refac_io:format("Cmd1:\n~p\n", [Cmd1]),
      case Cmd1 of 
          [] ->
              generate_cmds(Cmds, NameTrackerPid);
  
negative.code:                         false ->
                              case ERs of
                                  [{refactoring, Refac, Question}|Cs] ->
                                      From ! {self(), {ok, {interactive, Question, Refac}}, self()},
                                      interactive_refac_loop(Parent, State#state{cmds={interactive, Cs}});
                                  [] ->
                                      From ! {get_next_command, Parent, [ok,Changes]}
                              end
  