Update helper.py

minor changes for python3 support