smoothing function updated. works fine now.