anchor.diff:  -export([init/1, handle_call/3, handle_cast/2, handle_info/2,
        terminate/2, code_change/3]).
   
  --record(state, {sock}).
  +-record(state, {sock, seenqids}).
   -define(BROADCAST, {239,255,0,1}).
   
   %% API
  
positive.code: weight()                -> 95.
  targettime()            -> 50.
  
  send_response(A, Qid, Ip, Port) -> 
      gen_server:cast(?MODULE, {send_response, A, Qid, Ip, Port}).
  
  %% gen_server callbacks
  init([]) ->
      LAddr = {192,168,1,67},
      {ok, Sock} = gen_udp:open(60210, [binary, 
                                       {reuseaddr, true},{ip, ?BROADCAST}, 
                                       {add_membership, {?BROADCAST, LAddr}}]),
      {ok, #state{sock=Sock}}.
  
  handle_call(_Request, _From, State) ->
      Reply = ok,
  
negative.code: 
  handle_cast({resolve, Q, Qpid}, State) ->
      {struct, Parts} = Q,
  	Qid = qry:qid(Qpid),
  	% Ignore if we've dealt with this qid already
  	case ets:lookup(State#state.seenqids, Qid) of
  		[{Qid, true}] -> 
  			{noreply, State};
  		_ ->
  			ets:insert(State#state.seenqids, {Qid,true}),
  			Msg = {struct, [ {<<"_msgtype">>, <<"rq">>},{<<"qid">>,Qid} | Parts ]},
  			gen_udp:send(State#state.sock, ?BROADCAST, 60210, mochijson2:encode(Msg)),
  			{noreply, State}
  	end;
   
  handle_cast({send_response, A, Qid, Ip, Port}, State) ->
      %io:format("lan sending response: ~w ~w ~w ~w~n", [A, Qid, Ip, Port]),
  