everything working except calculating connectivity