new mlcm algorithm