Updated connected components to handle long vids