Cleaned up pd patch