Cleaned up the code a bit. Fixed PD stuff