added jsdoc and docco for documentation