Updated for Python