More sensible numEdges implementation.