Update lms.cpp