Implemented KnuthMorrisPratt