KMP with sequences