Add methods to get nodes and their weights