anchor.diff:      WithSyncTime = config_fun(config4(NodeNames)),
   
       % Test [cp1, cp2]
  -    ?line {ok, Cp1} = start_node_config(Ncp1, NoSyncTime, Conf),
  -    ?line {ok, Cp2} = start_node_config(Ncp2, WithSyncTime, Conf),
  +    {ok, Cp1} = start_node_config(Ncp1, NoSyncTime, Conf),
  +    {ok, Cp2} = start_node_config(Ncp2, WithSyncTime, Conf),
       Cps = [Cp1, Cp2],
  -    ?line wait_for_ready_net(),
  +    wait_for_ready_net(),
   
       % Start app1 and make sure cp1 starts it
  -    ?line {[ok,ok],[]} = 
  +    {[ok,ok],[]} = 
           rpc:multicall(Cps, application, load, [app1()]),
  -    ?line ?UNTIL(is_loaded(app1, Cps)),
  -    ?line ok = rpc:call(Cp1, application, start, [app1, permanent]),
  -    ?line ?UNTIL(is_started(app1, Cp1)),
  -    ?line false = is_started(app1, Cp2),
  +    ?UNTIL(is_loaded(app1, Cps)),
  +    ok = rpc:call(Cp1, application, start, [app1, permanent]),
  +    ?UNTIL(is_started(app1, Cp1)),
  +    false = is_started(app1, Cp2),
   
       % Start app1 on cp2; make sure it works (the bug was that this start
       % returned error)
  -    ?line ok = rpc:call(Cp2, application, start, [app1, permanent]),
  -    ?line true = is_started(app1, Cp1),
  -    ?line false = is_started(app1, Cp2),
  +    ok = rpc:call(Cp2, application, start, [app1, permanent]),
  +    true = is_started(app1, Cp1),
  +    false = is_started(app1, Cp2),
       
       stop_node_nice(Cp1),
       stop_node_nice(Cp2),
  
positive.code: start_phases(Conf) when is_list(Conf) ->
      %% start a help process to check the start type
      SpPid = spawn_link(?MODULE, start_phase, []),
      ?line yes = global:register_name(start_phase, SpPid),
  
      NodeNames = [Ncp1, _Ncp2, _Ncp3] = node_names([cp1, cp2, cp3], Conf),
      WithSyncTime = config_fun(config_sf(NodeNames)),
  
      ?line {ok, Cp1} = start_node_config_sf(Ncp1, WithSyncTime, Conf),
      ?line wait_for_ready_net(),
  
      %%=============================
      %%Example 1 in the user's guide
      %%=============================
      ?line ok = rpc:call(Cp1, application, load, [myApp, 
                                                   d_any3(myApp, NodeNames)]),
      ?line ?UNTIL(is_loaded(myApp, Cp1)),
      ?line ok = rpc:call(Cp1, application, start, [myApp, permanent]),
      ?line ?UNTIL(is_started(myApp, Cp1)),
      ?line ok = get_start_phase({sp, 0, 1, 0, 0, 1}),
      ?line ok = rpc:call(Cp1, application, stop, [myApp]),
  
      %%=============================
      %%Example 2 in the user's guide
      %%=============================
      ?line ok = rpc:call(Cp1, application, load, [topApp, 
                                                   d_any3(topApp, NodeNames)]),
      ?line ?UNTIL(is_loaded(topApp, Cp1)),
      ?line ok = rpc:call(Cp1, application, start, [topApp, permanent]),
      ?line ?UNTIL(is_started(topApp, Cp1)),
      ?line ok = get_start_phase({sp, 0, 1, 0, 0, 1}),
      ?line ok = rpc:call(Cp1, application, stop, [topApp]),
  	
      %%=============================
      %%Example 3 in the user's guide
      %%=============================
      ?line ok = rpc:call(Cp1, application, load, [topApp2, 
                                                   d_any3(topApp2, NodeNames)]),
      ?line ?UNTIL(is_loaded(topApp2, Cp1)),
      ?line ok = rpc:call(Cp1, application, start, [topApp2, permanent]),
      ?line ?UNTIL(is_started(topApp2, Cp1)),
      ?line ok = get_start_phase({sp, 0, 2, 0, 0, 3}),
      ?line ok = rpc:call(Cp1, application, stop, [topApp2]),
  
      %%=============================
      %%Example 4 in the user's guide
      %%=============================
      ?line ok = rpc:call(Cp1, application, load, [topApp3, 
                                                   d_any3(topApp3, NodeNames)]),
      ?line ?UNTIL(is_loaded(topApp3, Cp1)),
      ?line ok = rpc:call(Cp1, application, start, [topApp3, permanent]),
      ?line ?UNTIL(is_started(topApp3, Cp1)),
      ?line ok = get_start_phase({sp, 1, 3, 3, 2, 4}),
      ?line ok = rpc:call(Cp1, application, stop, [topApp3]),
  	
      global:send(start_phase, kill),
  
  
negative.code:     {OldKernel, OldEnv, {Cp1, Cp2, Cp3}, {Ncp1, _Ncp2, _Ncp3}, Config2} = 
  	distr_changed_prep(Conf),
  
      NewDist = {distributed, [{app1, [Cp3]},
  				   {app2, 5000, [Cp2]},
  				   {app3, [Cp3, {Cp1, Cp2}]},
  				   {app6, [Cp1, {Cp3, Cp2}]},
  				   {app7, 1000, [Cp3]},
  				   {app8, [Cp1, {Cp2, Cp3}]}]},
      
      NewKernel = [{kernel, lists:keyreplace(distributed, 1, OldKernel, NewDist)}],
      ok = rpc:call(Cp1, application_controller, test_change_apps, 
  			[[kernel], [NewKernel]]),
      ok = rpc:call(Cp2, application_controller, test_change_apps, 
  			[[kernel], [NewKernel]]),
      ok = rpc:call(Cp3, application_controller, test_change_apps, 
  			[[kernel], [NewKernel]]),
      
      {[ok,ok,ok],[]} = 
  	rpc:multicall([Cp1, Cp2, Cp3], 
  		      application_controller, config_change, [OldEnv]),
      
      test_server:sleep(4000),
      stop_node_nice(Cp1),   
      test_server:sleep(10000),
  
  %    _DcInfo1 = rpc:call(Cp1, dist_ac, info, []),
      _DcInfo2 = rpc:call(Cp2, dist_ac, info, []),
      _DcInfo3 = rpc:call(Cp3, dist_ac, info, []),
  %    ?t:format(0,"#### DcInfo1 ~n~p~n",[_DcInfo1]),
  
  %    DcWa1 = which_applications(Cp1),
      DcWa2 = which_applications(Cp2),
      DcWa3 = which_applications(Cp3),
      
  %    Wa1 = lists:foldl(fun({A1, _N1, _V1}, AccIn) -> [A1 | AccIn] end,
  %			    [], DcWa1),
      Wa2 = lists:foldl(fun({A2, _N2, _V2}, AccIn) -> [A2 | AccIn] end,
  			    [], DcWa2),
      Wa3 = lists:foldl(fun({A3, _N3, _V3}, AccIn) -> [A3 | AccIn] end,
  			    [], DcWa3),
  		  
  
      case lists:sort(Wa2) of
  	      [app2, app6, app8, kernel, stdlib] ->
  		  ok;
  	      EWa2 ->
  		  X2 = io_lib:format("distribution error: Cp2 ~p ",[EWa2]),
  		  test_server:fail(lists:flatten(X2))
  	  end,
  		  
      case lists:sort(Wa3) of
  	      [app1, app3, app7, kernel, stdlib] ->
  		  ok;
  	      EWa3 ->
  		  X3 = io_lib:format("distribution error: Cp3 ~p ",[EWa3]),
  		  test_server:fail(lists:flatten(X3))
  	  end,
  
  
      {ok, Cp1} = start_node_boot(Ncp1, Config2, dc),
      test_server:sleep(10000),
  
      _DcInfo1rs = rpc:call(Cp1, dist_ac, info, []),
      _DcInfo2rs = rpc:call(Cp2, dist_ac, info, []),
      _DcInfo3rs = rpc:call(Cp3, dist_ac, info, []),
  
      DcWa1rs = which_applications(Cp1),
      DcWa2rs = which_applications(Cp2),
      DcWa3rs = which_applications(Cp3),
      
      Wa1rs = lists:foldl(fun({A1, _N1, _V1}, AccIn) -> [A1 | AccIn] end,
  			      [], DcWa1rs),
      Wa2rs = lists:foldl(fun({A2, _N2, _V2}, AccIn) -> [A2 | AccIn] end,
  			      [], DcWa2rs),
      Wa3rs = lists:foldl(fun({A3, _N3, _V3}, AccIn) -> [A3 | AccIn] end,
  			      [], DcWa3rs),
  		  
      case lists:sort(Wa1rs) of
  	      [app6, app8, kernel, stdlib] ->
  		  ok;
  	      EWa1rs ->
  		  X1rs = io_lib:format("distribution error: Cp1 ~p ",[EWa1rs]),
  		  test_server:fail(lists:flatten(X1rs))
  	  end,
  		  
      case lists:sort(Wa2rs) of
  	      [app2, kernel, stdlib] ->
  		  ok;
  	      EWa2rs ->
  		  X2rs = io_lib:format("distribution error: Cp2 ~p ",[EWa2rs]),
  		  test_server:fail(lists:flatten(X2rs))
  	  end,
  		  
      case lists:sort(Wa3rs) of
  	      [app1, app3, app7, kernel, stdlib] ->
  		  ok;
  	      EWa3rs ->
  		  X3rs = io_lib:format("distribution error: Cp3 ~p ",[EWa3rs]),
  		  test_server:fail(lists:flatten(X3rs))
  	  end,
  
  
  