working with networkx