revise minimal.cpp and clone it to stasm_lm.cpp