Made clear the smoothing function is from scipy cookbook