LSM_algotithm