updates for python3, better sanetize