modified force_directed_graph.py