整理代码a
updated Main class