Added a function for fitting noisy data