wrapping some lines and renaming sub_N to patch_dist