What is this function doing?  Comment please.