A complete overhaul of monitor.py