Smoothing a path