modifications for python3 compatibility