added javadoc, and fixed some javadoc related problems