working on results aggregation and plotting code