Matt> OK, I've tried to convert your chi-squared stuff to Perl, but for Matt> some reason it's producing bizarre results. I think $S = log($S) + $Sexp + LN2; $H = log($H) + $Hexp + LN2; should be $S = log($S) + $Sexp * LN2; $H = log($H) + $Hexp * LN2; Skip