Added residual, corrected chi2 and added redchi