Cleaned up code Main.java