Purity calculations and plotting complete. So many results oh gawd