kmp improved