Changes for python3 compatability