Made sorting work