Added smoothing function. Should work
This is the file with the smoothing method