Changed from (1-P) = Q.
Some optimalizations of the code.
Cosmetic changes.