Added most of the javadocs.