Implemented the basics of the agent.