fixed edge finding. added basic graph plotting