anchor.diff:      MaxAgeSeconds = proplists:get_value(max_age, Options, 60),
       Supervisor = proplists:get_value(supervisor, Options),
       Channel = proplists:get_value(channel, Options),
  -    {ok, #state{max_age = MaxAgeSeconds, supervisor = Supervisor, channel = Channel}, 
  +    {ok, #state{max_age = MaxAgeSeconds, supervisor = Supervisor, channel = Channel, last_pull = erlang:now()}, 
           MaxAgeSeconds * 1000}.
   
   handle_call(_From, _, State) ->
  
positive.code:     NewSubscribers = [Subscriber|State#state.subscribers],
      gen_server:reply(From, ok),
      {noreply, State#state{subscribers = NewSubscribers}};
  handle_cast({From, pull, Timestamp, Subscriber}, State) ->
      NewSubscribers = case messages_newer_than_timestamp(Timestamp, State#state.messages) of
          ReturnMessages when erlang:length(ReturnMessages) > 0 ->
              Subscriber ! {self(), erlang:now(), ReturnMessages},
              State#state.subscribers;
          _ ->
              [Subscriber|State#state.subscribers]
      end,
      gen_server:reply(From, ok),
      {noreply, State#state{subscribers = NewSubscribers}};
  handle_cast({From, poll, undefined}, State) ->
      gen_server:reply(From, {ok, erlang:now(), State#state.messages}),
      {noreply, State};
  handle_cast({From, poll, Timestamp}, State) ->
      ReturnMessages = messages_newer_than_timestamp(Timestamp, State#state.messages),
      gen_server:reply(From, {ok, erlang:now(), ReturnMessages}),
      {noreply, State};
  handle_cast({From, push, Message}, State) ->
      Now = erlang:now(),
      lists:map(fun(Sub) ->
                  Sub ! {self(), Now, [Message]}
          end, State#state.subscribers),
      gen_server:reply(From, {ok, Now}),
      CurrentMessages = messages_newer_than_timestamp(now_minus_seconds(erlang:now(), 
              State#state.max_age), State#state.messages),
      NewMessages = [{Message, Now}|CurrentMessages],
      {noreply, State#state{messages = NewMessages, subscribers = []}}.
  
  terminate(_Reason, _State) ->
      ok.
  
negative.code: 
  messages_newer_than_timestamp(_, [], Acc) ->
      lists:reverse(Acc);
  messages_newer_than_timestamp({L1, M1, S1} = Ts1, [{Msg, {L2, M2, S2} = Ts2}|Rest], Acc) when (L2 > L1 orelse (L2 =:= L1 andalso (M2 > M1 orelse (M2 =:= M1 andalso S2 > S1)))) ->
      messages_newer_than_timestamp(Ts1, Rest, [{Msg, Ts2}|Acc]);
  messages_newer_than_timestamp(_, _, Acc) ->
      lists:reverse(Acc).
  
  pull_messages(Timestamp, Subscriber, State) ->
      Now = erlang:now(),
      case messages_newer_than_timestamp(Timestamp, State#state.messages) of
          ReturnMessages when erlang:length(ReturnMessages) > 0 ->
              Subscriber ! {self(), Now, lists:map(fun({Msg, _Ts}) -> Msg end, ReturnMessages)},
              {State#state.subscribers, Now};
          _ ->
              {[Subscriber|State#state.subscribers], Now}
      end.
  