Removed some unecessary vars. Added jsdoc comments.
Added jsdoc comments.