Updated the Graph constructor