initial gaussian smoothing algorithm