made this work on python3