reimplemented add edge and iterate on edges now work.