added fields id and p_id to struct of an element