modified python script