made imports more robust for python 3
made imports more robust for python 3