Update smj.cpp