a sorted array, with user-supplied sorting.