generalized the main scripts to account for th->emt,mmt