added javadoc and impl. comments