added JSDoc and some JSDoc markup