tried to simplify the agent a bit