            (lazy-cat lexical phrasal)
            (lazy-cat phrasal lexical))))))
 
-(defn add-all-comps [bolts language-model total-depth truncate-children max-total-depth]
+(defn add-all-comps
   "At each point in each bolt in the list of list of bolts,
-_bolt-groups_, add all possible complements at all open nodes in the
-bolt, from deepest and working upward to the top. Return a lazy
-sequence of having added all possible complements at each node in the
-bolt."
+  _bolt-groups_, add all possible complements at all open nodes in the
+  bolt, from deepest and working upward to the top. Return a lazy
+  sequence of having added all possible complements at each node in
+  the bolt."
+   [bolts language-model total-depth truncate-children max-total-depth]
   (lazy-mapcat
    (fn [bolt]
      (add-all-comps-with-paths [bolt] language-model total-depth

        (log/warn (str "generate: no expression could be generated for spec:" (strip-refs spec))))
      expression)))

(defn generate-all [spec language-model total-depth
                    & {:keys [max-total-depth truncate-children]
                       :or {max-total-depth max-total-depth
                            truncate-children true}}]
  "Returns all possible expressions generated by the given language model, constrained by the given spec.
   Depending on the grammar in the language model, could be an infinite number of expressions."
  (log/trace (str "generate-all: spec:" (strip-refs spec)))
  
  (let [total-depth (if total-depth total-depth 0)]
    (if truncate-children
      (->

       (lightning-bolts language-model spec 0 total-depth :max-total-depth max-total-depth)
       (add-all-comps language-model total-depth false max-total-depth)))))

(defn lightning-bolts
  "Returns a lazy-sequence of all possible bolts given a spec, where a bolt is a tree
  such that only the head children are generated. This sequence is used by (generate (above))
  to generate expressions by adding complements using (add-all-comps)."
  [language-model spec depth total-depth
                       & {:keys [max-total-depth]
                          :or {max-total-depth max-total-depth}}]
  (let [grammar (:grammar language-model)
        depth (if depth depth 0)
        ;; this is the relative depth; that is, the depth from the top of the current lightning bolt.
