added javadoc and corrected spelling mistakes