mods to test_agmg