adding KMP