added amgm.py