         max-depth max-total-depth]
     (mapfn #(do-defaults % model)
            (flatten
-            (mapfn #(add-bolt-at-2 % % [] % model depth max-depth)
+            (mapfn #(add-bolt-at % % [] % model depth max-depth)
                    (lightning-bolts model spec 0 max-total-depth))))))
 (defn generate-n
   "Returns all possible expressions generated by the given language model, constrained by the given spec.

                                 (+ 1 depth)
                                 max-depth
                                 top-bolt)))))))

(defn add-bolt-at-2 [top-bolt bolt path bolt-at model depth max-depth]
  (mapfn #(do-defaults % model)
         (if (= false (get-in bolt-at [:phrasal]))
           [bolt-at]
           (let [comp-paths (find-comp-paths bolt-at)
                 comp-bolts (map #(comp-path-to-bolts bolt-at % model depth max-depth)
                                 comp-paths)]
             (when (not (some empty? comp-bolts))
               (mapfn #(if true
                         bolt
                         nil))
               (add-comps bolt-at
                          model
                          comp-paths
                          comp-bolts
                          (+ 1 depth)
                          max-depth
                          bolt-at))))))
(defn generate2
  "Return all expressions matching spec _spec_ given the model _model_."
  [spec model]

                                 comp-paths)]
             (when (not (some empty? comp-bolts))
               (mapfn #(if (= bolt bolt-at)
                         %
                         (assoc-in bolt path %))
                      (add-comps bolt-at
                                 model
