   (add-to-available-tiles at 0 [nx ny 0 0 0]))
 
 (defn test-tiles [nx ny]
-  (doseq [i (range (- nx) (inc nx)) j (range (- ny) (inc ny))]
-    (Thread/sleep 1000)
-    (test-tile i j)))
+  (.start (Thread.
+            #(doseq [i (range (- nx) (inc nx)) j (range (- ny) (inc ny))]
+               (Thread/sleep 1000)
+               (test-tile i j)))))
 
 (defn test-rotate []
-  (.start (Thread. #(do (dorun (repeatedly 2000 (fn [] (Thread/sleep 10) (swap! angle + 0.02))))
+  (.start (Thread. #(do (dorun (repeatedly 2000 (fn [] (Thread/sleep 10)
+                                                  (swap! angle + 0.02))))
                         (reset! angle 0)))))
 
 


(defn get-tile [[nx ny nz nc nt]]
  (awt-image (grab-tagged-image)))

(defn add-tile [tile-map tile-zoom indices]
  (assoc-in tile-map [tile-zoom indices] (get-tile indices)))

(ns slide-explorer.display
  (:import (javax.swing AbstractAction JComponent JFrame JLabel KeyStroke)
           (java.awt Canvas Color Graphics Graphics2D RenderingHints Window)
           (java.awt.event ComponentAdapter KeyAdapter KeyEvent MouseAdapter
                           WindowAdapter)
           (java.awt.image BufferedImage WritableRaster)
           (java.awt.geom AffineTransform Point2D$Double)
           (java.io ByteArrayInputStream)
