Use nodeA & nodeB for areConnected method.