made spatial smoothing and ds optional