             (when (empty? (intersection (.get sim u) (post-2 w* r*)))
               (.put remove [u r*]
                     (conj (.get remove [u r*]) w*))
-              (.add non-empty-removes [u r*])))))
+              (.addLast non-empty-removes [u r*])))))
       (.put remove [v r] #{})
-      (.remove non-empty-removes [v r]))
+      (.removeFirst non-empty-removes))
     (HashMap->hash-map sim)))
 
 

    (doseq [v base-set-1,
            r R,
            :when (not (empty? (.get remove [v r])))]
      (.add non-empty-removes [v r]))
    (while-let [[v r] (first non-empty-removes)]
      (doseq [u (pre-1 v r),
              w (.get remove [v r])]
        (when (contains? (.get sim u) w)
          (.put sim u
                (disj (.get sim u) w))

        ^HashMap remove (nth vars 1),
        ^HashMap pre*   (nth vars 2),

        ^LinkedList non-empty-removes (LinkedList.),

        base-set-1 (:base-set G-1),
        post-2     (:post G-2),
