Clean up and javadoc added.