reorder columns and sort names