added convert to dataframe function