optimizing match min dfa