Added state automata for KMP