Well, that was well put. The only thing else I would have said was that the user should realize you're sorting the INDICES (pl. of "index", just in case...) of the array, not the elements; it's a nice trick. You basically sort the numbers 0 through $x in the order you want them in, and then you can do as Jasmine did: