quick fix on num_edges() for n