added main method and generated javadoc.