document for chisquare, cleaning