Added python3 support for c wrapper