Sorting multiple arrays