Added javadoc for main function