Finally some more work on the sorting thingy...