polished the run script