update Graph constructor
update main