Dph optimization

Optimized DPH code.
The new lines here are only indented 3 spaces, not 4.