sort functions work again