modify for python