Deterministic Finite State machine generation code
Move KMP to correct location