adding functions to convert adjacency matrix to graph for d3 rending