ported to py3 (not much needed ;)