more progress on newmain.cc