Add reorder function to deal with NC>=2.