added a faster dataframe version