Added functionality to visualize graphs.