update of fitting.py to correspond to the R version. R version included