fixed to reflect new format
added javadoc
start of more significant refactor