Fixed sorting algorithm
Ah, the joys of the lack of a proper type system