anchor.diff:  	    exit({error,no_file})
       end.
   
  -get_handler(Handler,Traci) ->
  -    case Handler of
  -	undefined ->
  -	    case dict:find(handler,Traci) of
  -		{ok,[H]} -> H;
  -		error -> undefined
  -	    end;
  -	_ ->
  -	    Handler
  -    end.
  -
  -do_format(Fd,Details) ->
  -    Clients = lists:foldl(fun({FileOrWrap,Traci,Handler},Acc) ->
  -				  [start_client(FileOrWrap,Traci,Handler)
  -				   |Acc]
  +do_format(Fd,Details,DisableSort,Handler) ->
  +    Clients = lists:foldl(fun({FileOrWrap,Traci},Acc) ->
  +                                  [start_client(FileOrWrap,Traci)|Acc]
   			  end,[],Details),
  -    init_collector(Fd,Clients).
  -
  -
  -start_client(FileOrWrap,Traci,et) ->
  +    init_collector(Fd,Clients,DisableSort,Handler).
  +
  +start_client(FileOrWrap,Traci) ->
       dbg:trace_client(file, FileOrWrap,
  -		     {fun handler/2,
  -		      {dict:to_list(Traci),{{ttb_et,handler},initial}}});
  -start_client(FileOrWrap,Traci,undefined) ->
  -    dbg:trace_client(file, FileOrWrap,
  -		     {fun handler/2,
  -		      {dict:to_list(Traci),{fun defaulthandler/4,initial}}});
  -start_client(FileOrWrap,Traci,Handler) ->
  -    dbg:trace_client(file, FileOrWrap,
  -		     {fun handler/2, {dict:to_list(Traci),Handler}}).
  -
  -handler(Trace,State) ->
  -    %% State here is only used for the initial state. The accumulated
  -    %% State is maintained by collector!!!
  +		     {fun handler/2, dict:to_list(Traci)}).
  +
  +handler(Trace,Traci) ->
  +    %%We return our own Traci so that it not necesarry to look it up
  +    %%This may take time if something huge has been written to it
       receive
  -	{get,Collector} -> Collector ! {self(),{Trace,State}};
  +	{get,Collector} -> Collector ! {self(),{Trace,Traci}};
   	done -> ok
       end,
  -    State.
  -
  -handler1(Trace,{Fd,{Traci,{Fun,State}}}) when is_function(Fun) ->
  -    {Traci,{Fun,Fun(Fd,Trace,Traci,State)}};
  -handler1(Trace,{Fd,{Traci,{{M,F},State}}}) when is_atom(M), is_atom(F) ->
  -    {Traci,{{M,F},M:F(Fd,Trace,Traci,State)}}.
  +    Traci.
  +
  +%%Used to handle common state (the same for all clients)
  +handler2(Trace,{Fd,Traci,{Fun,State}}) when is_function(Fun) ->
  +    {Fun, Fun(Fd, Trace, Traci, State)};
  +handler2(Trace,{Fd,Traci,{{M,F},State}}) when is_atom(M), is_atom(F) ->
  +    {{M,F}, M:F(Fd, Trace, Traci, State)}.
   
   defaulthandler(Fd,Trace,_Traci,initial) ->
       dbg:dhandler(Trace,Fd);
   defaulthandler(_Fd,Trace,_Traci,State) ->
       dbg:dhandler(Trace,State).
   
  -init_collector(Fd,Clients) ->
  +init_collector(Fd,Clients,DisableSort,Handler) ->
       Collected = get_first(Clients),
  -    collector(Fd,sort(Collected)).
  -
  -collector(Fd,[{_,{Client,{Trace,State}}} |Rest]) ->
  +    case DisableSort of
  +        true -> collector(Fd,Collected, DisableSort, Handler);
  +        false -> collector(Fd,sort(Collected), DisableSort, Handler)
  +    end.
  +
  +collector(Fd,[{_,{Client,{Trace,Traci}}} |Rest], DisableSort, CommonState) ->
       Trace1 = update_procinfo(Trace),
  -    State1 = handler1(Trace1,{Fd,State}),
  -    case get_next(Client,State1) of
  +    CommonState2 = handler2(Trace1, {Fd, Traci, CommonState}),
  +    case get_next(Client) of
   	end_of_trace ->
  -	    handler1(end_of_trace,{Fd,State1}),
  -	    collector(Fd,Rest);
  -	Next -> collector(Fd,sort([Next|Rest]))
  +	    collector(Fd,Rest,DisableSort, CommonState2);
  +	Next -> case DisableSort of
  +                    false -> collector(Fd,sort([Next|Rest]), DisableSort, CommonState2);
  +                    true -> collector(Fd,[Next|Rest], DisableSort, CommonState2)
  +                end
       end;
  -collector(_Fd,[]) ->
  +collector(Fd,[], _, CommonState) ->
  +    handler2(end_of_trace, {Fd, end_of_trace, CommonState}),
       ok.
   
   update_procinfo({drop,_N}=Trace) ->
  
positive.code: host(Node) ->
      [_name,Host] = string:tokens(atom_to_list(Node),"@"),
      Host.
  
  wait_for_fetch([]) ->
      ok;
  
negative.code: 	      _ -> standard_io
  	  end,
      Handler = case lists:keysearch(handler,1,Opt) of
                    {value,{handler,H}} -> H;
                    _ -> undefined
  	  end,
      DisableSort = proplists:get_value(disable_sort, Opt, false),
      {Out,Handler,DisableSort};
  format_opt(Opt) ->
      format_opt([Opt]).
  
  
  read_traci(File) ->
      MetaFile = get_metafile(File),
  