updated MainClass.java