edited p_add