Oh yeah that was the issue, sorting. It's been a while so I had forgotten.
Yes the array needs to be full first, do you know where that logic is and when it has all the data?
Once full I would use something like this to convert back to int, this logic assuming Y=0 and Y=1 are values to turn back to int :
System for from 0 to array.width : array set value at xy(loopindex,0) to int(array.at(loopindex,0))
System for from 0 to array.width : array set value at xy(loopindex,1) to int(array.at(loopindex,1))
That should convert all the string numbers to ints that can be properly sorted