helps to connect the nodes to the correct node