Added Agent and Device code