anchor.diff:              end
       end;
   
  -handle_call({unsub,ClientId,Seq}, _From, S = #state{live_subs = Subs}) ->
  -    case dict:find(ClientId, Subs) of
  +handle_call({unsub,ClientId,Seq}, _From, S = #state{live_subs = Subs,
  +                                                    queue = SQ,
  +                                                    garbage = Garbage}) ->
  +    case dict:find(ClientId,Subs) of
           error ->
               {reply,ok,S};
           {ok, Reg} ->
               case Reg of
                   #sub{monref = MonRef,client_seq = OldSeq} when Seq >= OldSeq ->
                       mqtt_sub_repo:remove_sub(S#state.filter,ClientId),
  -                    #state{monref_idx = Mon, min_acks = MAck} = S,
  +                    #state{monref_idx = Mon} = S,
                       Mon1 = maybe_demonitor_reg(MonRef,Mon),
                       Subs1 = dict:erase(ClientId,Subs),
  -                    Min = min_val_tree:min(MAck),
  -                    MAcks1 = min_val_tree:remove(ClientId, MAck),
  -                    Min1 = min_val_tree:min(MAcks1),
  +                    {MoreGarbage,SQ1} = shared_queue:remove(ClientId,SQ),
                       S1 = S#state{monref_idx = Mon1,
                                    live_subs = Subs1,
  -                                 min_acks = MAcks1},
  +                                 queue = SQ1,
  +                                 garbage = ?MONOID:as(Garbage,MoreGarbage)},
                       case dict:size(Subs1) of
                           0 -> {stop, no_subs,ok,S1};
                           _ -> {reply,ok,S1}
  
positive.code: send_packets_to_client(CPid,Ps,QoS) ->
      [send_packet(CPid,P,QoS) || P <- Ps].
  
  send_packet(CPid,P,QoS)   -> CPid ! {push,P,QoS}.
  
  %%send_packets(Range,CPid,#state{filter = Filter, queue = SQ}) ->
  %%    Ps = get_packets(Range,Filter,SQ),
  
negative.code:      end,
      {ok,{reply,ok},S1}.
  
  handle_ack(ClientId,AckSeq,S = #state{queue = SQ,garbage = Garbage}) ->
      {MoreGarbage,SQ1} = shared_queue:move(ClientId,AckSeq,SQ),
      S#state{queue = SQ1,garbage = ?MONOID:as(Garbage,MoreGarbage)}.
  
  
  %%maybe_process_pending1(PSeq,Ack,Wnd,Sub = #sub{last_sent = LSent,
  