                   :board empty-board
 
                   :animating false
-                  :highlighted-rows #{}}))
+                  :flashing-rows #{}}))
 
 ;;------------------------------------------------------------
 ;; VCR (record game)

        gy    (get-drop-pos piece x y board)
        board1 (write-piece-to-board ghost x gy board)
        board2 (write-piece-to-board piece x y board1)
        board3 (highlight-rows (:highlighted-rows @state) board2)]
    board3))

(defn draw-state

  (let [board (:board @state)
        rows (get-filled-row-indices board)]

    (when (> (count rows) 0)
      (swap! state assoc :animating true)
      (go
        ; blink n times
        (doseq [i (range 3)]

          (<! (timeout 100))                      ; resume here in 0.5 seconds
          (swap! state assoc :flashing-rows rows) ; flash rows

          (<! (timeout 100))                      ; resume here in 0.5 seconds
          (swap! state update-in
                 [:flashing-rows] empty))         ; unflash rows

        ; finally collapse
        (collapse-rows!)
        (swap! state assoc :animating false)))))

