Some work done on sorting.  Only remaining part SHOULD be correctly querying the data.