implemented addEdge

not yet tested.