added kmp alg