Added function for writing comment.