updates to python code