I'm having a hard time telling what this function is supposed to do. Maybe add a comment or change the name?