Update comments, added javadoc