Updated agent.cpp to compound.cpp