 
                    :else
                    (when (covers? sets rest-base-set)
-                     (search (difference rest-base-set (first sets))
-                             (conj current-cover (first sets))
-                             (reduce! (fn [map x]
-                                        (if (contains? base-set x)
-                                          (assoc! map x (inc (get map x)))
-                                          map))
-                                      cover-count
-                                      (first sets))
-                             (rest sets))
-                     (search rest-base-set
-                             current-cover
-                             cover-count
-                             (rest sets)))))]
+                     (let [counts (map-by-fn #(count (intersection rest-base-set %))
+                                             sets),
+                           sets   (sort #(>= (counts %1) (counts %2))
+                                        sets)],
+                       (search (difference rest-base-set (first sets))
+                               (conj current-cover (first sets))
+                               (reduce! (fn [map x]
+                                          (if (contains? base-set x)
+                                            (assoc! map x (inc (get map x)))
+                                            map))
+                                        cover-count
+                                        (first sets))
+                               (rest sets))
+                       (search rest-base-set
+                               current-cover
+                               cover-count
+                               (rest sets))))))]
     (search base-set
             #{}
             (map-by-fn (constantly 0) base-set)

          (<= 2 (get count x))))))

(defn- minimum-covers [base-set sets]
  (let [sets    (sort #(>= (count %1) (count %2)) sets),
        result  (atom []),
        search  (fn search [rest-base-set current-cover cover-count sets]
                  (cond
                   (redundant? base-set current-cover cover-count)

                                 (for [N M
                                       :when (subset? A N),
                                       m (gens A),
                                       :when (not= (gens N) #{m})]
                                   (make-implication #{m} (gens N)))),
              candidates   (set-of U | U (disj M A),
                                       :let [UcapA (intersection U A)]
                                       :when (not (exists [V M]
                                                    (and (proper-subset? V A)
                                                         (subset? UcapA V))))),
              candidates   (difference candidates
                                       (set-of (intersection X Y) | X candidates, Y candidates
                                                                    :when (and (not (subset? X Y))
