implemented basic maximum likelihood fitter