Added JSDoc for the functions