I'd like a friendly JSDoc overview of what this function does :)