making table sorting work in the combineArrays snippet