Update ama.py

This seems to be working