struggling to sort multi-dimensional lists