added implementation of string matching automaton