A high-level description of what this function does would really help.