chisquare is done but ugly