refactored get_stats, added chi_mean