build chi2 table