If it's not a big dip in performance, I think `new_nearest_segment[*coords.T] = adjacent` would be more readable here... Especially if you change `coords` to `current_connected_coords` or something like that. =)