Update ct_functions.py