moved printing details into the Graph class