Used a sort function that actually works.