Revert "just ported to Python"

This reverts commit d0d0e410b97a7f365fc3d257c01a90b83d2ad68c.