switch complely to using dataframes