                  (fn [key]
                    (if (keyword? key)
                      (let [lexical-form surface-form
-                           looked-up (lookup-fn lexical-form)]
+                           looked-up (get lexicon lexical-form)]
                        (map #(unifyc % (:unify-with (get replace-pairs key)))
                             looked-up))))
                  (keys replace-pairs)))]

                   (if (and (not (keyword? key)) (re-find key surface-form))
                     (let [lexical-form (string/replace surface-form key
                                                        (:replace-with (get replace-pairs key)))
                           looked-up (lookup-fn lexical-form)]
                       (map #(unifyc % (:unify-with (get replace-pairs key)))
                            looked-up))))
                 (keys replace-pairs)))

   {:unify-with {:synsem {:cat :noun
                          :agr {:number :sing}}}}})

(defn analyze [surface-form lexicon]
  "return the map incorporating the lexical information about a surface form."
  (let [replace-pairs
        (merge 
