Pid changes

Rebased as requested