added some python2/3-compatibility