changed kmp search for a better benchmark