Cleaned up version that removes copies of the dataframes for lines and levels