anchor.diff:  %% Coordinator
   %%------------------------------------------------------------------------------------------------
   start_coordinator(Settings) ->
  -    pg2:create(?GROUP_NAME),
  -    Coordinator = spawn(fun() -> coordinator_fn(Settings) end),
  -    pg2:join(?GROUP_NAME, Coordinator).
  -
  -coordinator_fn(Settings) ->
  -    lager:debug("coordinator process ~p", [self()]),
  -    config:store_scenario_settings(Settings),
  -    config:dump_settings(),
  -    coordinator_loop([]).
  -
  -coordinator_loop(AllPids) ->
  -    N = get_room_size(),
  -    case wait_for_n_clients([], N) of
  -        {timeout, []} when AllPids =:= [] -> coordinator_loop([]);
  -        {timeout, Pids} ->
  -            activate_users(Pids, n_rooms),
  -            activate_users(Pids ++ AllPids, all_rooms),
  -            lager:error("Waited too long for the new user!"),
  -            coordinator_loop([]);
  -        {ok, Pids} ->
  -            activate_users(Pids, n_rooms),
  -            coordinator_loop(Pids ++ AllPids)
  -    end.
  -
  -wait_for_n_clients(PidsAndJids, 0) ->
  -    make_full_rooms(PidsAndJids),
  -    Pids = [Pid || {Pid, _} <- PidsAndJids],
  -    {ok, Pids};
  -wait_for_n_clients(PidsAndJids, N) ->
  -    receive
  -        {new_client, NewPid, NewJid} ->
  -            lager:debug("Coordinator received ~p~n", [NewJid]),
  -            wait_for_n_clients([{NewPid, NewJid} | PidsAndJids], N - 1)
  -    after ?COORDINATOR_TIMEOUT ->
  -        Pids = [Pid || {Pid, _} <- PidsAndJids],
  -        make_full_rooms(PidsAndJids),
  -        {timeout, Pids}
  -    end.
  -
  -make_full_rooms(PidsAndJids) ->
  +    Plan = get_plan(),
  +    coordinator:start_link(Plan, Settings).
  +
  +get_plan() ->
  +    [{get_room_size(), fun(PidsAndClients) ->
  +        make_full_rooms(PidsAndClients),
  +        activate_users(pids(PidsAndClients), n_rooms)
  +                       end},
  +     {all, fun(PidsAndClients) -> activate_users(pids(PidsAndClients), all_rooms) end}].
  +
  +pids(PidsAndClients) ->
  +    {Pids, _Clients} = lists:unzip(PidsAndClients),
  +    Pids.
  +
  +make_full_rooms(PidsAndClients) ->
  +    PidsAndJids = [{Pid, Client#client.jid} || {Pid, Client} <- PidsAndClients],
       [begin
            MemberJids = [Jid || {_, Jid} <- PidsAndJids, Jid =/= OwnerJid],
            OwnerPid ! {add_users, MemberJids}
  
positive.code: 
          {add_users, MemberJids} ->
              add_users_to_room(Client, MemberJids),
              user_loop(Client, Time)
      end.
  
  
  schedule_publishing(Pid) ->
      amoc_throttle:send(?PUBLICATION_THROTTLING, Pid, publish_item).
  
  update_publication_interval(0, _Now) ->
      ok;
  
negative.code: update_message_ttd(Time, Now) ->
      Interval = Now - Time,
      amoc_metrics:update_time(message_ttd, Interval).
  
  remove_self(Client) ->
      UserName = escalus_client:username(Client),
      UserServer = escalus_client:server(Client),
      Path = list_to_binary(["/api/users/", UserServer, "/", UserName]),
      Host = get_parameter(mim_rest_endpoint),
      {ok, R} = http_req:request(Host, Path, <<"DELETE">>, []),
      lager:debug("removing user ~p:~n~p", [UserName,R]),
      ?STOP_USER.
  
  %%------------------------------------------------------------------------------------------------
  %% User connection
  