Updated javadoc and comments