added javadoc, updated examples