 (defn inversions [grid]
   (let [cells (order grid)]
     (->>
-      (range (count grid))
+      grid
+      count
+      range
       (map
         (fn [n]
           (->>
-            (drop n cells)
+            cells
+            (drop n)
             (filter #(< % (nth cells n)))
             count)))
       (reduce +))))



(defn modal [{:keys [stream media-error show-about? result-gif cells win-state
                     grid-size tick-ms gif-building?] :as app}]
  (let [winner?    (and cells (= cells win-state))
        no-stream? (not stream)]
    (dom/div


(defn make-cell-list [size]
  (->
    size
    sq
    dec
    range
    vec
