updated for python3