Could you please add a comment on what this function does?