further improvements to contingency table (#1769)