working on spatial smoothing