Reinstall main.cxx again to fix amsdisplay

PLEASE do not modify.