updated comments and jsdocs