added getEdge function.