setupAgent function added. Transfer commit.