unified tail_sweep.py