Added some more comments to the PND function