 ; and then it should add a :results section to the siteinfo map
 ; which contains a map of keynames and scraped data
 (defn find-data [siteinfo page]
-  (let [items (page (:datamatcher siteinfo))]
+  (reset! itables (index-tables))
+  (assoc siteinfo :data (into {} (let [items (page (:datamatcher siteinfo))]
     (for [[keyname item] items]
-      (let [[location re] item]
-        (dispatch-location location re)
-        ))))
-
+        [keyname (dispatch-location item)]
+        )))))
+

    (catch NullPointerException e false) ))

(defn search-table [t re]
  (let [itable (index-table-text t)]
    (some-what #(match? re (last %)) itable)
    ) )

(defn find-cell-by-coordinate [[x,y]]
  (println "cell at:" x y)
  )

(defn find-cell-by-offset [[x,y] re]
  (println "looking for" re " and then " x y)
  (let [match (search-table )])
  )

;location should be like:
;[:offset [x,y]]
;[x,y]
(defn find-table-cell-by-location [location re]
  (case (first location)
    :offset (find-cell-by-offset (first (rest location)) re)
    (find-cell-by-coordinate location)
    )
  )

(defn dispatch-location [location re]  
  (case (first location)
    :table (find-table-cell-by-location (rest location) re)
    :miss)
    )



(defn index-tables []
  (for [t (find-elements [{:tag :table}])]
    (index-table-text t)))

(defn match? [re x]
  (try
