my last throw at the sorting problem