Make sort more stable so stacked queries of the same length don't dance around
Improve links