lots and lots of sorting