fixed sample_edges