updated javadoc and comments