update smj.cpp