Sorting in different ways using a callback function.