modified to further move the agent