More modification to python code