anchor.diff:      false-> io:fwrite(FD," ~p~n",[Term])
     end.
   
  -send_to_wd(Term) ->
  -  try
  -    ?MODULE ! Term,
  -    ok
  -  catch 
  -    error:badarg   -> {error,watchdog_not_started};
  -    _:R            -> {error,R}
  -  end.
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   expand_recs(List) when is_list(List) -> [expand_recs(L)||L<-List];
   expand_recs(Tup) when is_tuple(Tup) -> 
     case tuple_size(Tup) of
       L when L < 1 -> Tup;
       L ->
  -      Fields = ri(element(1,Tup)),
  +      Fields = rec_info(element(1,Tup)),
         case L == length(Fields)+1 of
   	false-> list_to_tuple(expand_recs(tuple_to_list(Tup)));
   	true -> expand_recs(lists:zip(Fields,tl(tuple_to_list(Tup))))
         end
     end;
   expand_recs(Term) -> Term.
  -
  -ri(ld) -> record_info(fields,ld);
  -ri(_) -> [].
  
positive.code: clean_triggers(Triggers,IDs) ->
    lists:filter(fun({ID,_})->not lists:member(ID,IDs) end, Triggers).
  
  %%exit if What is jailed
  check_jailed(LD,What) ->
    false = lists:member(What, LD#ld.jailed),
    erlang:start_timer(timeout(release), self(), {release, What}),
    LD#ld{jailed=[What|LD#ld.jailed]}.
  
  do_mon(LD) ->
    send_report(LD,sysMon),
  
negative.code: check_triggers([T|Ts],Data,O) ->
    check_triggers(Ts,Data,try [check_trigger(T,Data)|O] catch _:_-> O end).
  
  check_trigger({ticker,true},_Data) ->
    {ticker,true};
  check_trigger({ID,T},Data) when is_function(T) -> 
    case T(get_measurement(ID,Data)) of
      true -> {ID,T};
      NewT when is_function(NewT)  -> {ID,NewT}
    end.
  
  delete_subscriber(Key,Subs) -> 
    lists:keydelete(Key,1,Subs).
  
  add_subscriber(Key,Val,Subs) ->
    try Sub = mk_subscriber(Key,Val),
        case lists:keysearch(Key,1,Subs) of
          false -> [{Key,Sub}|Subs];
          _     -> lists:keyreplace(Key,1,Subs,Sub)
        end
    catch _:R ->
        ?log([{subscriber_not_added,R},{Key,Val}])
      end.
  
  send_report(LD,Trigger) ->
    Report = make_report(Trigger,LD),
    [Sub(Report) || {_,Sub} <- LD#ld.subscribers].
  
  make_report(user,LD) ->
    reporter(user,LD#ld.userData);
  