Method sortByNames() has to sort names from 2D array - newNames