made compatible with python 3.3 (and below)