added documentation with jsdoc