made changes to include multiple histograms and plotting macros