moved kmp string matching to a class. reusability FTW