CustomAgents example improved