added javadoc and final version