CLRS kmp understanding