added Javadoc, other cleanup