handle sorting with multiple scores