Change KMM algorithm