Added java docs and comments