Added existing agent code