added changes to make ag1 and ag3 work, ag2 still failing
added changes to make ag1 and ag3 work, ag2 still failing