updated script so it returns column sort instead of row sort. doh!