Added Agent Logic