code formatting and javadoc