More comments, javadoc, cleanup.