adds possibility of passing pData directly as dataframe