anchor.diff:  -define(DEBUG(Format,Args),logger ! ["DEBUG",?FILE,?LINE,Format,Args]).
   %-define(DEBUG(Format,Args),ok).
   
  -% create record types for out DB's
  -%---------------------------------
  -% worker record just marks if a worker socket is busy
  --record(worker, {sock,state=ready}).
  -% function record maps the available functions onto the worker sockets
  --record(function, {sock,name}).
  -
  --record(work, {id,ctime,name,data,client_id,client,assigned=null,schedule}).
   
   start() ->
       ok = application:start(crypto),
  -    % start up mnesia DB
  -    ok = application:start(mnesia),
  -    % create our tables, in memory only on local node
  -    {atomic,ok} = mnesia:create_table(worker, [{ram_copies,[node()]},{type,set},{attributes,record_info(fields,worker)}]),
  -    {atomic,ok} = mnesia:create_table(function, [{ram_copies,[node()]},{type,bag},{attributes,record_info(fields,function)}]),
  -
  -    % create our memory + disk tables:
  -    {atomic,ok} = mnesia:create_table(work, [{ram_copies,[node()]},{type,bag},{attributes,record_info(fields,work)}]),
  -
  -    % make sure tables are created before we continue
  -    ok = mnesia:wait_for_tables([work,worker,function],infinity),
  +    register(randproc,spawn(fun() -> rand_loop(crypto:rand_bytes(8092),0) end)),
   
       register(logger, spawn(fun() -> logger_loop() end)),
  -    register(randproc,spawn(fun() -> rand_loop(crypto:rand_bytes(8092),0) end)),
       register(wakeup, spawn(fun() -> wakeup_loop() end)), 
  +
  +    erligig_db:start(),
   
       % bind to our listn port then start acceptint connections
       {ok, ListenSocket} = gen_tcp:listen(8888, [{active,false}, binary, {reuseaddr, true}]),
  
positive.code: -module(erligig).
  -export([start/0]).
  
  -include_lib("stdlib/include/qlc.hrl").
  
  -define(REQ,<<"\0REQ">>).
  -define(RES,<<"\0RES">>).
  
negative.code: 
  rand(Len) ->
      randproc ! {self(),Len},
      receive {ok,Data} -> Data end.
  
  rand_loop(Data,Offset) ->
      receive
  