agent4.py updated