major changes to the Main.java