Got the tasks to work as I wanted. Next is some clean up of the prototype.
Used the logger instead of print statements.