#16 reactive implementation of agent