   public rough sad safe secret short shut simple slow small soft solid
   special strange thin white wrong")
 
-(defonce app-state (atom {:items ["foo"
-                                  "Basic English is an English-based controlled language created by linguist and philosopher Charles Kay Ogden as an international auxiliary language, and as an aid for teaching English as a second language. Basic English is, in essence, a simplified subset of regular English. It was presented in Ogden's book Basic English: A General Introduction with Rules and Grammar (1930).
-
-Ogden's Basic, and the concept of a simplified English, gained its greatest publicity just after the Allied victory in World War II as a means for world peace. Although Basic English was not built into a program, similar simplifications have been devised for various international uses. Ogden's associate I. A. Richards promoted its use in schools in China.[1] More recently, it has influenced the creation of Voice of America's Special English for news broadcasting, and Simplified English, another English-based controlled language designed to write technical manuals."
-                                  #_"Foobar [[foo|blitz]] lolophone hoptigoff."]}))
+;; TODO: Move this too.
+;; Old with link "Foobar [[foo|blitz]] lolophone hoptigoff."
+
+(defonce app-state (atom {:search "Foobar"
+                          :word-map {"Ogden" [0]}
+                          :visible [0]
+                          :items [[0 "Basic English is an English-based controlled language created by linguist and philosopher Charles Kay Ogden as an international auxiliary language, and as an aid for teaching English as a second language. Basic English is, in essence, a simplified subset of regular English. It was presented in Ogden's book Basic English: A General Introduction with Rules and Grammar (1930).
+
+Ogden's Basic, and the concept of a simplified English, gained its greatest publicity just after the Allied victory in World War II as a means for world peace. Although Basic English was not built into a program, similar simplifications have been devised for various international uses. Ogden's associate I. A. Richards promoted its use in schools in China. More recently, it has influenced the creation of Voice of America's Special English for news broadcasting, and Simplified English, another English-based controlled language designed to write technical manuals."]
+                                  [1 "Foo"]
+                                  [2 "Hello there"]]}))
+
+;; before items looked like this
+;; :items [{:id "foo" :text "bar"}] ;; dammit!
+
+(def id-atom (atom 0))
+(swap! id-atom inc) ;; first item
+(swap! id-atom inc) ;; second item
 
 (defn add-item [app owner]
-  (let [new-item (-> (om/get-node owner "new-item")
-                     .-value)]
+  (let [new-item-text (-> (om/get-node owner "new-item")
+                     .-value)
+        new-item {:id (swap! id-atom inc) :text new-item-text}]
     (when new-item
       (om/transact! app :items #(conj % new-item)))))
-
-(defn handle-change [e owner {:keys [text]}]
+;; Do this when adding
+;;(str (naive-key-extractor item) ", ")
+
+(defn search [app owner]
+  (let [search (-> (om/get-node owner "search")
+                   .-value)]
+    (when search
+      (om/transact! app :search (fn [] search)))))
+
+;; also filter views?
+
+;; TODO: when adding note, add/merge words-item to word-map
+
+(defn handle-item-change [e owner {:keys [text]}]
   (let [value (.. e -target -value)
         count (count value)]
     (om/set-state! owner :count count)

            [om.dom :as dom :include-macros true]
            [cljs.core.async :refer [put! chan <!]]))

(def basic-list
  "come get give go keep let make put seem take be do have say see
  send may will about across after against among at before between by

;; then merge
;; should be elsewhere?

#_(defn item-view [item owner]
  (reify
    om/IRender
    (render [this]
      (dom/li nil
              (apply dom/div nil
                     (str (:text item))
                     (str (naive-key-extractor item) ", ")
                     #_(prepare-item item))))))

(defn visible-item-view [item owner]
  (reify
    om/IRender
    (render [this]
      (dom/li nil
              (apply dom/div nil
                     (str (second item)))))))

(defn app-view [app owner]
  (reify
