make sorting work