Added documentation and also made parts of running.py more modular