small changes to work with python3