added intermediate functions.py