sorting functions work again