add the common functions for analyzing data and plotting