function rename and added jsdoc