     {:world (init-world) :screen screen :time 0}))
 
 (defn tick [state]
-  (let [keyin  (s/get-key-blocking (state :screen))]
-    (println "got " keyin " type " (type keyin))
-    (let [newstate (update-state state keyin)
-          state-with-tick (update-in newstate [:time] (fn [t] (inc t)))]
-      (render state-with-tick)
-      state-with-tick)))
-
+  (do
+    (render state)
+    (let [keyin  (s/get-key-blocking (state :screen))]
+      (println "got " keyin " type " (type keyin))
+      (let [newstate (update-state state keyin)
+            state-with-tick (update-in newstate [:time] (fn [t] (inc t)))]
+        state-with-tick))))
+

        ;;(println cell x y)
        (when (not (nil? cell))
          (let [cell-items (cell :items)
                out-char (if (not (nil? cell-items))
                           (case :ring 
                             :ring           ["="]
                             :food           ["%"]

        state))))

(defn pick-up [state keyin]
  (let [place (-> state :world :current-place)
        [player-cell x y] (player-cellxy state)
        items (player-cell :items)
        remaining-hotkeys (-> state :world :remaining-hotkeys)
        item-index (.indexOf remaining-hotkeys keyin)
        item (nth items item-index)
        new-state (-> state
          ;; dup the item into inventory with hotkey
          (update-in [:world :player :inventory]
            (fn [prev-inventory]
              (conj prev-inventory (nth items item-index))))
          ;; remove the item from cell
          (assoc-in [:world :places place y x :items]
           (vec (concat (subvec items 0 item-index)
                        (subvec items (inc item-index) (count items)))))
          ;;;; hotkey is no longer available
          (assoc-in [:world :remaining-hotkeys]
            (vec (concat (subvec remaining-hotkeys 0 item-index)
                         (subvec remaining-hotkeys (inc item-index) (count remaining-hotkeys))))))]
    (println "picking up at:" x y "item with index" item-index "item" item)
    (println "new-state" new-state)
    (println "cell-items (-> state :world :places" place y x ":items)")
    new-state))

(defn toggle-inventory [state]
  (println "toggle-inventory" (not (-> state :world :show-inventory?)))
