Added -p support for PID monitoring. Fixed a bit indentation.