add threads in analysis.py