Write PPNF.

In this commit the function ppnf was write.

It still have to be tested and bugs removed.
Correct some bugs in PPNF.