Adding index function to graph_controller.