planning to add checkConnectivity function