better implementation of smoothing avoids aliasing effects