What is the purpose of this function exactly?