Changed the getEdge method to return a reference for changing the edges.