added javadoc and comment