Reformatted code for view_graph