Added agent and device code.