added distance offset and pure smoothing