Agent in c