anchor.diff:  %% api
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   start() -> 
  -  case gen_serv:start(?MODULE) of
  -    {ok,Pid} ->  Pid;
  -    {error,{already_started,Pid}} -> Pid
  +  Init = fun(D) -> fun() -> init(D) end end,       % mmm.... haskell....
  +  {Pid,Ref} = erlang:spawn_monitor(Init(self())), 
  +  receive
  +    {Pid,ok} -> erlang:demonitor(Ref,[flush]),Pid;
  +    {'DOWN',Ref,_,Pid,OldPid} -> OldPid
     end.
   
   stop() -> 
  -  gen_serv:stop().
  +  send_to_wd(stop).
   
   add_proc_subscriber(Pid) when is_pid(Pid) ->
     case is_process_alive(Pid) of
  -    true -> send_to_wd({add_subscriber,{{pid,Pid},mk_send(Pid)}});
  +    true -> send_to_wd({add_subscriber,mk_send(Pid)});
       false-> {error,no_such_pid}
     end;
   add_proc_subscriber(Reg) when is_atom(Reg) ->
  -  send_to_wd({add_subscriber,{{Reg,node()},mk_send(Reg)}});
  +  send_to_wd({add_subscriber,mk_send(Reg)});
   add_proc_subscriber({Reg,Node}) when is_atom(Reg),is_atom(Node) ->
  -  send_to_wd({add_subscriber,{{Reg,Node},mk_send({Reg,Node})}}).
  +  send_to_wd({add_subscriber,mk_send({Reg,Node})}).
   
   %% E.g:  watchdog:add_send_subscriber(tcp,"localhost",56669,"I'm a Cookie").
   %% it's possible to add the same subscriber twice. this is a bug.
   add_send_subscriber(Proto,Host,Port,PassPhrase) ->
     case inet:gethostbyname(Host) of
       {ok,{hostent,Host,[],inet,4,_}} -> 
  -      Key = {Proto,{Host,Port}},
  -      send_to_wd({add_subscriber,{Key,mk_send(Proto,Host,Port,PassPhrase)}});
  +      send_to_wd({add_subscriber,mk_send(Proto,Host,Port,PassPhrase)});
       {ok,{hostent,G,[W],inet,4,_}} -> {error,{badhost,W,G}};
       {ok,R}                        -> {error,R};
       {error,R}                     -> {error,R}
     end.
   
   add_log_subscriber() ->
  -  try ?MODULE ! {add_subscriber,{log,mk_log(group_leader())}}, ok
  +  try ?MODULE ! {add_subscriber,mk_log(group_leader())}, ok
     catch _:R -> {error,R}
     end.
   
  
positive.code: clean_triggers(Triggers,IDs) ->
    lists:filter(fun({ID,_})->not lists:member(ID,IDs) end, Triggers).
  
  check_jailed(LD,_) when ?max_jailed < length(LD#ld.jailed) ->
    % we take a timeout when enough pids are jailed. conservative is good.
    erlang:start_timer(timeout(restart), self(), restart),
    stop_monitor(),
    flush(),
    throw(taking_timeout);
  check_jailed(LD,What) ->
    case lists:member(What, LD#ld.jailed) of
      false-> 
        erlang:start_timer(timeout(release), self(), {release, What}),
        LD#ld{jailed=[What|LD#ld.jailed]};
      true -> 
        throw(is_jailed)
      end.
  
  do_mon(LD) ->
    send_report(LD,sysMon),
  
negative.code: 	 ,monData			 %last system_monitor data
  	}).
  
  %% constants
  
  default_triggers() -> 
  