        dom/div nil
        (om/build-all row grid)))))
 
-(defn move-hero! [e app]
-  (console-log (get-in @app [:hero :jump-time]))
+(defn start-moving [e app]
   (condp = (aget e "keyCode")
-    88 (om/transact! app [:hero :position :left] (fn [i] (+ i 10)))
-    90 (om/transact! app [:hero :position :left] (fn [i] (- i 10)))
-    32 (when-not (get-in @app [:hero :jump-time])
-         (om/update! app [:hero :jump-time] (.getTime (js/Date.))))
+    88 (om/update! app [:hero :move] :left)
+    90 (om/update! app [:hero :move] :right)
+    32 (when-not (get-in @app [:hero :jump])
+         (om/update! app [:hero :jump] (.getTime (js/Date.))))
     nil
     )
+  )
 
+(defn stop-moving [e app]
+  (condp = (aget e "keyCode")
+    88 (om/update! app [:hero :move] false)
+    90 (om/update! app [:hero :move] false)
+    nil
+    )
   )
 
 (defn main []

      (reify
        om/IRender
        (render [_]
          (dom/div #js {:className "grid" :tabIndex 0 :onKeyDown (fn [e] (move-hero! e app))}
                   (om/build hero app)
                   (om/build grid (:grid app))))))
    app-state


(defn gravity [app]
  (let [dy (get-in @app [:hero :position :bottom])
        t (get-in @app [:hero :jump])
        dt (/ (- (.getTime (js/Date.)) t) 1000)
        vforce (* v dt)
        gforce (/ (* g dt dt) 2)
