Modified for Python3
Modified for Python3