     (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])]
+      (.addFirst non-empty-removes [v r]))
+    (while-let [[v r] (.peekFirst non-empty-removes)]
+      (doseq [w (.get remove [v r]),
+              u (pre-1 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),

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

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

        conexp.contrib.dl.framework.semantics
        conexp.contrib.dl.util.graphs)
  (:use clojure.contrib.pprint)
  (:import [java.util HashMap LinkedList]))

(ns-doc
 "Implements description graphs and common operations on them.")
