Work in progress on detector.py.