added p_edge util