add Javadoc and format Code