Using encode for Python 3