Updated print method in graph