added javadoc and changed typo in documentation