small changes to the python code