KMP implemented