Make analysis.py more readable