         state))))
 
 (defn pick-up [state keyin]
-  (let [place (current-place state)
+  (let [place (-> state :world :current-place)
         [player-cell x y] (player-cellxy state)
-        items (player-cellxy :items)
-        item-index (.indexOf (state :world :remaining-hotkeys) keyin)]
-    (-> 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
-      (update-in [:world :places place y x :items]
-        (fn [prev-items] (vec (concat (subvec prev-items 0 (dec item-index))
-                                      (subvec prev-items item-index (count prev-items))))))
-      ;; hotkey is no longer available
-      (update-in [:world :remaining-hotkeys]
-        (fn [prev-keys] (vec (concat (subvec prev-keys 0 (dec item-index))
-                                     (subvec prev-keys item-index (count prev-keys)))))))))
+        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?)))

  
  
(defn update-state [state keyin]
  (println "last-command " (get-last-command state))
  (case (get-last-command state)
    :open (let [state-with-command (set-last-command state nil)]
            (open-door state-with-command (case keyin
                                            \h :left
                                            \j :down
                                            \k :up
                                            \l :right)))
    :close (let [state-with-command (set-last-command state nil)]
             (close-door state-with-command (case keyin
                                              \h :left
                                              \j :down
                                              \k :up
                                              \l :right)))
    :pick-up (let [state-with-command(set-last-command state nil)]
               (pick-up state-with-command keyin))
    (case keyin
      \h (move-left state)
      \j (move-down state)
      \k (move-up state)
      \l (move-right state)
      \i (toggle-inventory state)
      \, (toggle-pick-up state)
      \o (set-last-command state :open)
      \c (set-last-command state :close)
      state)))

(defn render-pick-up [state]
  ;; maybe draw pick up menu

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