refactor to add graph ref to Element; added initial edge work