Changed CPD to use function P and modified diagnosis test
Merged