Please explain the contract of this function.