update javadoc and code formatting