Update Main.java

Adding Functions