Add some functions to run.py