updated javadoc and tests