Fitting procedure implemented and debugged!