reorganize contingency table