easy version of kmp