Made it compatible with python3