adding code to link the data tables for analysis and plotting