first try of iterative fitter. Not working at the moment.