Implemented position-dependent smoothing