                                                    (:non-past-ops cell))}))
 
 (defn step [^Integer k ^IConfig config plans ^SearchPlanCell cell]
-  ; the idea here is that we have operations in non-past-ops that may or may not be applicable at the moment
-  ; because we haven't checked them for required constraints. so first figure out the applicable ops
+  ;; the idea here is that we have operations in non-past-ops that may or may not be applicable at the moment
+  ;; because we haven't checked them for required constraints. so first figure out the applicable ops
   (let [cost-binding-pairs (for [non-past-binding (:non-past-ops cell)
-                                 ; remember that for bindings will result in a mapcat (just like in Scala)
-                                 ; sou using this can look weird but generally a single non-past op
-                                 ; can branch into more than one present op because
-                                 ; required constraints have not been checked
+                                 ;; remember that for bindings will result in a mapcat (just like in Scala)
+                                 ;; sou using this can look weird but generally a single non-past op
+                                 ;; can branch into more than one present op because
+                                 ;; required constraints have not been checked
                                  present-binding (bind-op (:op non-past-binding)
                                                           (:var-lkp non-past-binding)
                                                           (:constr-lkp cell)
                                                           [:bound])
-                                 ; replace the things this operation will do if we
-                                 ; eventually choose it
-                                 ; note that we can do this instead of concating because only
-                                 ; free constraints are moved (binding an op
-                                 ; for required constraints always results in an empty list)
+                                 ;; replace the things this operation will do if we
+                                 ;; eventually choose it
+                                 ;; note that we can do this instead of concating because only
+                                 ;; free constraints are moved (binding an op
+                                 ;; for required constraints always results in an empty list)
                                  :let [present-binding (assoc-in present-binding [:done] (:done non-past-binding))]
-                                 ; the cost-fn requires that the op is properly bound to vars, so we do that here
-                                 ; yeah, it smells that we have two different representations for the damn same thing
-                                 ; so refactor once you have the fatigue
+                                 ;; the cost-fn requires that the op is properly bound to vars, so we do that here
+                                 ;; yeah, it smells that we have two different representations for the damn same thing
+                                 ;; so refactor once you have the fatigue
                                  :let [op-binding (bind-map (:op present-binding) (:var-lkp present-binding))
                                        weight (estimation/get-weight (:weight-calculator cell) config op-binding (:constr-lkp cell))]]
                              [weight present-binding op-binding])]
-    ; go through all applicable ops and try to fit them somewhere in our table.
+    ;; go through all applicable ops and try to fit them somewhere in our table.
     (reduce (fn [plans [weight present-binding op-binding]]
-              ; we have to find out how many constraints are getting bound because that determines the first index.
-              ; it should be equal to the length of the done list as everything in there is a single newly bound
-              ; constraint
+              ;; we have to find out how many constraints are getting bound because that determines the first index.
+              ;; it should be equal to the length of the done list as everything in there is a single newly bound
+              ;; constraint
               (let [index (- (:free-count cell) (count (:done present-binding))) ; 3:9
                     column (get plans index)
                     ordered-cells (get column :ordered-cells)

  [op var-lkp constr-lkp condition-types]
  (let [conditions (map #(case %1 :free [:satisfies :free]
                                  :bound [:requires :bound]) condition-types)]
    ; this check is not required, it serves as an optimization
    ; for exiting as early as possible in this highly likely situation
    (if-not (reduce #(and %1 (subset?
                               (keys (get op (nth %2 0)))
                               (into #{} (keys (lookup/lookup-by-type constr-lkp (nth %2 1)))))) conditions)
      ()
      (let [sorted-constr (apply union (map #(build-match-list op
                                                               ; this is shady but we only replace the constraints with their counts
                                                               ; on the respective map
                                                               (fmap count (lookup/lookup-by-type constr-lkp (nth %1 1)))
                                                               %1) conditions))]
        (loop [open (list (map->BindingBranchNode {:op      op

                                                                             (constraint/->ConstraintBinding type bindings))
                                                                           (:done present-binding)))
                    free (lookup/lookup constr-lkp :free)
                    ;; determine duplicate (if any)
                    dupe (get-in column [:cells-by-free free])
                    ;; determine whether it fits into the k best or not (only needed if not a dupe actually)
                    full? (>= (count ordered-cells) k)]
                (cond
                  (some? dupe) (if (< (compare cost-calculator (:cost-calculator dupe)) 0)
                                 ;; this is better, evict dupe
                                 (let [cell (create-search-plan-cell index cost-calculator
                                                                     weight-calculator op-binding
                                                                     cell constr-lkp)]
                                   (-> plans
                                       (update-in [index :ordered-cells] #(-> %1 (disj dupe) (conj cell)))
                                       (assoc-in [index :cells-by-free free] cell)))
                                 ;; existing is better, so don't modify the plan
                                 plans)
                  ;; we can fit it in somehow, either by consuming an empty slot, or replacing the worst
                  (or (not full?)
                      (< (compare cost-calculator
                                  (-> ordered-cells first :cost-calculator))
