make compatible with python 3