restored monitor.py