convert sort order to array