add merge_path and downsample and smooth_radius function