                                  (+ 1 depth)
                                  max-depth
                                  top-bolt
-                                 truncate?))))))))
+                                 truncate?
+                                 take-n))))))))
 (defn generate2
   "Return all expressions matching spec _spec_ given the model _model_."
   [spec model

     (flatten
      (mapfn #(do
                (log/debug (str "top-level add-bolt-at: " ((:morph-ps model) %)))
                (add-bolt-at % % [] % model depth max-depth truncate-children))
             (lightning-bolts model spec 0 max-total-depth)))))

(defn generate-n

        (mapfn #(add-comps % model
                           (rest comp-paths)
                           (rest bolts-at-paths)
                           depth max-depth top-bolt truncate? take-n)
               (let [path (first comp-paths)
                     bolts-at (first bolts-at-paths)]
                 (flatten
                  (mapfn #(let [bolt (assoc-in bolt path %)]
                            (if (= false (get-in % [:phrasal]))
                              [bolt]
                              (-> (add-bolt-at top-bolt bolt path % model depth max-depth truncate? take-n)
                                  ((fn [with-added-complement]
                                     (if truncate? (truncate with-added-complement [path] model)
                                         with-added-complement))))))
                         bolts-at)))))))))

(defn add-bolt-at [top-bolt bolt path bolt-at model depth max-depth truncate? & [take-n]]
  (lazy-seq
   (mapfn #(do-defaults % model)
          (let [comp-paths (find-comp-paths bolt-at)
                comp-bolts
                (pmap #(if (or true take-n)
                         (take take-n (comp-path-to-bolts bolt-at % model (+ 1 depth) max-depth))
                         (comp-path-to-bolts bolt-at % model (+ 1 depth) max-depth))
                       comp-paths)]
            (when (not (some empty? comp-bolts))
              (lazy-seq
               (mapfn #(assoc-in bolt path %)
