Starting to move away from networkx dependence.
Removed references to G.node.
Working version, with all networkx dependence removed.