made compatible with python3