extended run.py for testing