Added PD code

This is not working code, just lines copied from Charles without the
constants. This will be added to later.