Sort:  

Not promising anything yet you understand! And I would need to turn your formulas into a JavaScript algorithm. Probably doable, but I'd need to look at it in more detail.

Of course. :)