Rewrote p_data to return a dataframe instead of the static doc.