AM: sync from BGY3D repo