Added javadoc and comments;