Sort:  

Precisely! It shouldn't be too difficult to implement it, either.