added kmp implementation