Update Main.java

modified to use arraylists instead of 2 dimensional arrays