add javadoc and comments