Added for each loop in sortNames function