implemented an agent
(not working yet)