in reply to sorting an array of an arrays
You already have a couple of suggestions for how to solve your problem, but since no one pointed you to resources where you can get more information about sorting, here are a few: