Sorting values from highest to lowest z value.
Next step is to set an attribute on each data point saying what position it has in the array.

Also need to calculate the max # of elements across all arrays.