Update doc_access.py

Changed to a function so it can be called from run_me.py