Move agents container to the function to allow using function with
different arguments