add more comments and generate java doc

The javadoc is in the doc folder