finished KMP