Updates to the python function