added chi2 in return