anchor.diff:  
   set_seq_for_filter({Filter,Seq},Subs) ->
       case orddict:find(Filter,Subs) of
  -        {ok,{QoS,_}} -> orddict:store(Filter,{QoS,Seq},Subs);
  +        {ok,{pending,QoS,CurSeq}}   -> orddict:store(Filter,{QoS,mqtt_seq:max(CurSeq,Seq)},Subs);
           _ -> Subs
       end.
   
  
positive.code: maybe_add_sub({Filter,QoS},Subs) ->
      NewSub =
          case orddict:find(Filter,Subs) of
              {ok,{_,Seq}} -> {QoS,Seq};
              error        -> {QoS,pending}
          end,
      {QoS1,Seq1} = NewSub,
      {{Filter,QoS1,Seq1},orddict:store(Filter,NewSub,Subs)}.
  
  set_seq(FiltersSeq,S = #outgoing{subs = Subs}) ->
  
negative.code: 
  set_actual_qos(Subs,Packet = #packet{topic = Topic,
                                       qos = MsgQoS}) ->
      Packet#packet{qos = get_actual_qos(Subs,Topic,MsgQoS)}.
  
  get_actual_qos(Subs,Topic,MsgQoS) ->
      SubL = [{SubFilter,SubQoS} || {SubFilter,{SubQoS,_}} <- orddict:to_list(Subs)],
      {ok,{_,SubQos}} = mqtt_topic:best_match(SubL,Topic),
      min(MsgQoS,SubQos).
  
  push_to_session(Packet = #packet{qos =?QOS_0},SO) ->
      Pub = to_publish(Packet),
  