reworked agent module and added simple example