simplified trace_edges code.