test added, javadocs added