What does this function do? Could you include a doc-string with a description?