@Petra, I see that sortIdx, sortRank , and findIdx return int* / int. Makes sense for plot to return a constant. Ok. what does sortData return? int, var, vars ? i get the error cannot convert void to long. also if they return integers, how would i get the sorted array? it returns an integer while the sorted array of size length is of interest.