sort column names and row names