add method to print graphs