refactor graph implementation
update how edges are added