comments java docs and formatting fixes