Can you add some comments on how this function is used and why it exists?