cleanup of dataframe code. Still lots more work to go.