Changes in the way counting the nodes and finding the max connection links