modernized for Python 3