add code documentation, and generated javadocs