 ; fix up ears for dynamic variables (done)
 ; indent arg vectors and comment strings
 ; that annoying todo below about needing i computed before hand
-
+; testing 
+; logging
 	
 (def ^:dynamic *phrasal-patterns-map* {})
 (def ^:dynamic *completed-patterns* {})
 
 
 (defn reset []
-	(def *phrasal-patterns-map* {})
-	(def *completed-patterns* {}) 
+	(def ^:dynamic *phrasal-patterns-map* {})
+	(def ^:dynamic *completed-patterns* {}) 
 	(println ""))
 
 ; A phrasal pattern is used to define and run or advance pattern discovery.

						; TODO: why does i need save above?
						;(assoc 	(:slot-vlaues pattern) (nth (:tokens pattern) (:token-index pattern)) value )
				  )]
					(if (complete-pattern? pp) 
						(println " " (pp :frame) " is complete.")
						(println " " (pp :frame) " is waiting for " 
							(pp :token-index) 
							(nth (pp :tokens) (pp :token-index)) ))
					;;(println "concept advanced pattern" pp)
					pp  ))
		:t  nil))

					(= literal (nth (:tokens pattern) (:token-index pattern)))))
		(do 
			(def i (:token-index pattern))
			#_(print "      advance-literal slots:" (:slot-values pattern) " frame:" (pattern :frame) " literal:" literal) 
			(let [retval (create-phrasal-pattern 
				(:tokens pattern) 
				(:frame pattern) 
