Updated Main.Java

Now calls methods instead of invoking raw code. Added documentation.