Added some Javadoc
Refactored the Main class