Added javadoc comments where needed.