Added JavaDocs and comments.