Add process monitor code, still WIP.