minor changes in python code