added sume functions!!!! graphs generate, purity....