I used Gtri and Rsort in just the right way.