modernizing the graph creation