Sorting and Function Pointers Implementation