added support for python 2