Add jsdoc3-style annotations to help with readability as well. What does this function do and what should we expect from its parameters?