anchor.diff:  fac(0) -> 1;
   fac(N) -> N * fac(N-1). 
   
  -% gen_server behavior callbacks
  +% gen_server behavior callback implementation
   
   init(Wait) ->
       ?Debug("~p starting...~n", [?MODULE]),
       imem_meta:create_check_table(?ddTestName, {record_info(fields, ddTest),?ddTest, #ddTest{}}, [{type,ordered_set},{record_name,ddTest}], system),
  -    imem_test_writer:write_test_record(0,0,0.0,"fac start"),
  +    imem_test_writer:write_test_record(0,0,0.0,"starting------------------------------"),
       random:seed(os:timestamp()),
  -    erlang:send_after(Wait, self(), write_record),    
  +    erlang:send_after(Wait, self(), next_event),    
       ?Debug("~p started!~n", [?MODULE]),
       {ok,#state{wait=Wait}}.
   
  -handle_info(write_record, #state{wait=Wait}) ->
  -    Ran = random:uniform(),       %% 0..1
  -    %% X = round(30*Ran),         %% bad version causing 1/0
  -    X = round(29*Ran) +1 ,
  -    FX = fac(X),
  -    OneOverX = 1.0/X, 
  -    imem_test_writer:write_test_record(X,FX,OneOverX,"fac next"),
  -    erlang:send_after(Wait, self(), write_record),
  -    {noreply, #state{wait=Wait}}.
  +terminate(_Reason, _State) -> ok.
  +code_change(_OldVsn, State, _Extra) -> {ok, State}.
  +format_status(_Opt, [_PDict, _State]) -> ok.
   
   handle_call({wait, Wait}, _From, #state{}=State) ->
       {reply, ok, State#state{wait=Wait}};
  
positive.code:                   , comment   ::list()
                    }
         ).
  -define(ddTest, [timestamp,integer,integer,float,string]).
  
  -define(ddTestName,ddTest@).  %% node sharded 
  
  -record(state,  % factorial state (stateless apart from delay)
                  {wait = 1000}).
  
  % gen_server API calls
  
  -export([ start_link/1
          , start/1
          , stop/0
          , start_supervised/1
          , stop_supervised/0
          , wait/1
          , write_test_record/4
          , fac/1
          ]).
  
  % gen_server behavior callbacks
  
  -export([ init/1
          , handle_call/3
  
negative.code: -module(imem_test_writer).
  
  % -ifdef(TEST).                   % empty module in production
  
  -include("imem.hrl").           % import logging macros
  -include("imem_meta.hrl").      % import exceptions and data types
  
  -behavior(gen_server).          % implicitly defines the required callbacks
  
  -record(ddTest,   % test table record definition with erlang types
                    { time      ::ddTimestamp()
                    , x         ::integer()
                    , fX        ::integer()
  