checking and sorting the correct names

Checking and sorting the correct names