Sorts a user-entered array.