   (let [products (mapv prepare-product (load-input (:products-uri conf)))]
     (with-open [listings (io/reader (:listings-uri conf))
                 out (io/writer (:out-uri conf))]
-      (doseq [result (->> (line-seq listings)
-                          (map parse-json)
-                          (map #(match-product products %)))]
-        (json/generate-stream result out)))))
+      (doseq [item (->> (line-seq listings)
+                        (map parse-json)
+                        (domatch products))]
+        (json/generate-stream item out)
+        (.write out "\n")))))

    (when-let [[_ match] (match-title products listing')]
      [listing match])))

(defn domatch [products listings]
  (let [matches (->> listings
                     (pmap #(match products %))  ; pmap was a 4x speedup
                     (filter some?))]

       (some #(when (.startsWith (remove-chars (:manufacturer listing)) %)
                %))))

(defn match-title
  "Attempts to match listing to a product in products, returning a vector
  [score matching-product] if successful, else nil."
  [products listing]
        ; Longer than just manufacturer name
  (let [min-match-len (max 3 (count (:manufacturer listing)))
        matches (->> products
                     (map #(vector (common-prefix-length (:title listing)
                                                         (:product_name %))
                                   %))
                     (filter (fn [[score prod]]
                               (and (> score min-match-len)
