Enabling sorting in both directions