accidently made changes here instead of rainier. improving logic in find_connectivity