Added javadoc, more to follow.