changes to analysis.py