added chi2 squared function based on Tyler Harter's implementation  to the stats.py module