Update Main.java

changes, notes on memory leak