 
   (pause incrementer)
   (unpause incrementer)
-  (:kn @incrementer)
+  (-> @incrementer :kn :old)
 
   (def fetcher (run-env {:kn #{{:name "content" :value "Click button to fetch google"}}
-                         :tick-rules [(rule {:name :ui/text :id "content-ui-0" :text text}
-                                             (- {:name :ui/text :id "content-ui-0" :text text}))
-                                       (rule {:name :http-get :url "https://google.com" :id "google"}
-                                             (- {:name :http-get :url "https://google.com" :id "google"}))
-                                       (rule {:name :ui/onClick :id "fetch-button"}
-                                             (+ {:name :http-get :url "https://google.com" :id "google"}))
-                                       (rule {:name :http-response :id "google" :data data}
-                                             {:name "content" :value v}
-                                             (- {:name "content" :value v})
-                                             (+ {:name "content" :value data}))
-                                       ]
+                         :cleanup-rules (concat ui-cleanup-rules timer-cleanup-rules io-cleanup-rules
+                                                [])
+                         :tick-rules [(rule {:name :ui/onClick :id "fetch-button"}
+                                            (+ {:name :http-get :url "https://google.com" :id "google"}))
+                                      (rule {:name :http-response :id "google" :data data}
+                                            (> {:name "content"} {:value data}))
+                                      ]
                          :rules [[(rule {:name "content" :value v}
                                         (+s (hiccup
                                              [:p {:id "content-ui"} v]

                             (- {:name :ui/event-listener :id id :entity entity :event event}))
                       ])

  (def tick (run-env {:kn #{[3 5] [9 8 7] [:tick]}
                      :tick-rules [(rule {:name :wait :time t :id i}
                                         (- {:name :wait :time t :id i}))]
                      :rules [(rule [:tick]
                                  (- [:tick])
                                  (+ {:name :wait :time 1000 :id 1}))
                              (rule {:name :tick :id 1 :timestamp ts}
                                  (+ [:tick])
                                  (+ ["hi!" ts]))]}))

  (pause tick)
  (unpause tick)
  @tick

  (def clock (run-env {:kn #{{:name :tick :id "clock" :timestamp ""}}
                       :tick-rules [(rule {:name :wait :time t :id i}
                                          (- {:name :wait :time t :id i}))
                                    (rule {:name :ui/text :id "time-0" :text text}
                                          (- {:name :ui/text :id "time-0" :text text}))
                                    (rule {:name :tick :id "clock" :timestamp ts}
                                          (+ {:name :wait :time 1000 :id "clock"}))
                                    ]
                       :rules [[(rule {:name :tick :id "clock" :timestamp ts}
                                      (+s (hiccup [:p {:id "time"} (str "time is: " (js/Date. ts))])))
                                ]]
                       }))

  (pause clock)
  (unpause clock)
  @clock

  (def incrementer (run-env {:kn #{{:name "counter" :value 0}}
                             :tick-rules [(rule {:name :ui/text :id "counter-ui-0" :text text}
                                                (- {:name :ui/text :id "counter-ui-0" :text text}))
                                          (rule {:name :ui/onClick :id "incr-button"}
                                                {:name "counter" :value v}
                                                (- {:name "counter" :value v})
                                                (+ {:name "counter" :value (inc v)}))]
                             :rules [[(rule {:name "counter" :value v}
                                            (+s (hiccup
                                                 [:p {:id "counter-ui"} v]

                                     )]
                              ]}))

  ((query ^todo {:name :todo/edit-text}
          (+ todo)) (-> @todo :kn))

  (enable-console-print!)
  )
