Sort:  

thanks @rentmoney!
can't believe I wrote it myself :)