some of the python code