modify python code