Added JSDoc and other comments