sc_main done. will debug tomorrow