cleaned up and added javadoc.