updated javadoc and formatting