 
 (defn- badness
   "given line and page width returns measurement how `pretty` the line is"
-  [line-lens page-width]
-  (let [total-length (+ (reduce + line-lens) (count line-lens) -1)] ;; remember to count whitespaces
+  [words-lengths page-width]
+  (let [total-length (+ (reduce + words-lengths) (count words-lengths) -1)] ;; count whitespaces too
     (if (> total-length page-width)
       js/Infinity
       (let [a (- page-width total-length)] (* a a a)) )))

          ;;words (vec (filter .blank? (flatten (map #(prepare-word page-width %) words-raw))))
          words (vec (flatten (map #(prepare-word page-width %) words-raw)))
          word-lens (vec (map count words))
          justified-text (tj-inner word-lens page-width)]
        ; (.log js/console "words" (count words) ":" words)
        ; (.log js/console "state" (count justified-text) ":" justified-text)
        (update-state

      )
    (.profileEnd js.console)
  ))


