now also takes dataframe