anchor.diff:                                 live_subs = Subs,
                                  queue = Q}) ->
       SQ1 = shared_queue:pushr(Packet,Q),
  -    %%NewSeq = shared_queue:max_offset(SQ1),
       {SendTo,Subs1} = dict:fold(update_waiting_subs(SQ1),{[],Subs},Subs),
       error_logger:info_msg("About to send packet ~p for filter ~p to ~p out of subs ~p~n",[Packet,Filter,SendTo,dict:to_list(Subs)]),
       {SendTo,S#state{live_subs = Subs1,queue = SQ1}}.
  
positive.code: %% so we default it to 0. The client will "forward" its subscription to the appropriate Seq number once
  %% it comes back online
  %% @end
  recover_sub({ClientId,_QoS,_CSeq,_ClientPid},Q) ->
      shared_queue:add_client(ClientId,0,Q).
  
  recover(SubL,RetL,S) ->
      Acc = lists:foldl(fun accumulator_gb_tree:acc/2,accumulator_gb_tree:id(),RetL),
      Q = shared_queue:new(0,Acc),
      Q1 = lists:foldl(fun recover_sub/2,Q,SubL),
      S#state{queue = Q1}.
  
  
negative.code: 
  process_unsub(ClientId,S = #state{live_subs = Subs,
                                   queue = SQ,
                                   garbage = Garbage,
                                   client_offsets = Offsets}) ->
      Offsets1 = min_val_tree:remove(ClientId,Offsets),
      MinVal = min_val_tree:min(Offsets),
      {MoreGarbage,SQ1} = shared_queue:truncate(MinVal,SQ),
      S#state{live_subs = dict:erase(ClientId,Subs),
              queue = SQ1,
              client_offsets = Offsets1,
              garbage = ?MONOID:as(Garbage,MoreGarbage)}.
  
  handle_resume({ClientId,CSeq,QoS,ResumeFrom,WSize},Pid,S = #state{filter = Filter,
  