saving and plotting