modified ana.py