Update knutt-morris-pratt

without global variables