         ; (.log js/console "state" (count justified-text) ":" justified-text)
         (update-state justified-text)
       )
+    ; (.profileEnd js.console)
   ))

  (clear-state)
  (doseq [paragraph (prepare-text text separate-paragraphs)]
    ; (println "PARAGRAPH:" paragraph)
    (let [words-raw (.split paragraph #" ")
          words (vec (flatten (map #(prepare-word page-width %) words-raw)))
          justified-text (text-justification-inner words page-width)]

  (let [total-length (utils/line-length line)]
    (if (> total-length page-width)
      js/Infinity
      (let [a (- page-width total-length)] (* a a a)) )))


;; cache results (memo)
