Implementation of smoothing class (with @JulianKahnert).