Fixed comparator sort function to use CALLBACK declaration