--- life-orig.clj	2009-03-16 11:20:52.000000000 -0400
+++ life.clj	2009-03-16 11:20:43.000000000 -0400
@@ -50,20 +50,19 @@
  (doseq [[[x,y] state] @cells]
    (doto graphics
-     (. setColor (if state Color/RED Color/WHITE))
-     (. fillRect (* cell-size x) (* cell-size y) cell-size cell-size))))
+     (.setColor (if state Color/RED Color/WHITE))
+     (.fillRect (* cell-size x) (* cell-size y) cell-size cell-size))))
 
 (defn toggle-thread [#^JPanel panel button]
  (if @running
    (do (dosync (ref-set running false))
-     (. button (setText "Start")))
+     (.setText button "Start"))
    (do (dosync (ref-set running true))
-     (. button (setText "Stop"))
-     (. (Thread.
+     (.setText button "Stop")
+     (.start (Thread.
           #(loop []
              (calc-state determine-new-state)
-             (. panel repaint)
+             (.repaint panel)
              (if life-delay (Thread/sleep life-delay))
-             (if @running (recur))))
-       start))))
+             (if @running (recur))))))))
 
 (defn -main[]
@@ -71,19 +70,28 @@
   (calc-state determine-initial-state)
 
-  (let [f (JFrame.)
-        b (JButton. "Start")
+  (let [f           (JFrame.)
+        startButton (JButton. "Start")
+        resetButton (JButton. "Reset")
         panel (proxy [JPanel] [] (paint [graphics] (paint-cells graphics)))]
     
     (doto f
-      (. setLayout (BorderLayout.))
-      (. setLocation 100 100)
-      (. setPreferredSize (Dimension. (* cell-size x-cells) (+ 60 (* cell-size y-cells))))
-      (. add b BorderLayout/SOUTH)
-      (. add panel BorderLayout/CENTER)
-      (. setDefaultCloseOperation JFrame/EXIT_ON_CLOSE)
-      (. pack)
-      (. setVisible true))
+      (.setLayout (BorderLayout.))
+      (.setLocation 100 100)
+      (.setPreferredSize (Dimension. (* cell-size x-cells) (+ 60 (* cell-size y-cells))))
+      (.add startButton BorderLayout/SOUTH)
+      (.add resetButton BorderLayout/NORTH)
+      (.add panel BorderLayout/CENTER)
+      (.setDefaultCloseOperation JFrame/EXIT_ON_CLOSE)
+      (.pack)
+      (.setVisible true))
     
-    (. b addActionListener
-       (proxy [ActionListener] []
-         (actionPerformed [evt] (toggle-thread panel b))))))
+    (.addActionListener startButton
+                        (proxy [ActionListener] []
+                          (actionPerformed [evt] (toggle-thread panel startButton))))
+    (.addActionListener resetButton 
+                        (proxy [ActionListener] []
+                          (actionPerformed [evt] 
+                                           (calc-state determine-initial-state)
+                                           (.repaint panel))))))
+
+
