Enhance main program in ass.2