Improved sorting.