Initial smoothing code (untested, and test (not implemented)