added chisq fitting scripts