completed KMP