Added chisq function

commented out red_chisq_uniform for now because it's not necessary