modified MainClass.java