create analysis.py and clean up test.py