   (require [crawler.dom :as dom]))
 
 (defn state-action
-  ([page-src url]
-     (state-action page-src url []))
+  "Args:
+    page-src : the body
+    url      : the source url
+    template-removed: Xpath, Href pairs that we remove from the decision space"
+  ([page-src url template-removed]
+     (state-action page-src url template-removed []))
 
-  ([page-src url blacklist]
+  ([page-src url template-removed blacklist]
      (let [processed-pg         (dom/html->xml-doc page-src)
 
            ; xpaths nodes and associated anchor-text

                                 processed-pg
                                 url
                                 blacklist)
           xpaths-anchors-chars (map
                                 (fn [[xpath nodes]]
                                   [xpath (map

                                       0
                                       nodes)))
                                 0
                                 template-removed)

           xpath-nav-info       (filter
                                 #(not
                                   (or
                                    (-> % :score zero?)
                                    (-> % :hrefs count zero?)))
                                 (map
                                  (fn [[xpath info]]
                                    {:xpath xpath
                                     :score (reduce
                                             (fn [acc an-info]
                                               (+ acc (:num-chars an-info)))
                                             0
                                             info)
                                    
                                     :hrefs (reduce
                                             (fn [acc an-info]
                                               (cons (:href an-info) acc))
                                             '()
                                             info)})
                                  xpaths-anchors-chars))]
       
       {:total-nav-info page-wide-nav-chars
        :xpath-nav-info (sort-by :score xpath-nav-info)})))

