combined kmp functions, much fast wow