added Javadoc for remaining code