python3 compatibility edits