Cleaned up analysis.py