Added Java docs and did a code clean up