more thorough Javadoc comments for DemData and slight refactoring