Setting up the agent