added sort() function to alphabetize the names in the array first