Make compatible with python 3