added check digits for PI generation.