working on converting this to use an Agent