added java docs
refactoring and java docs
java documentation
fixed merge conflicts