Initial working version for Python 3