Also, you don't even need an own compare function for SortArray, if you only want to compare the first element of the struct since 18.1.