Working version with Python2 and Python3