Added additional javadoc and added further tests.