tested against py2.6, py3.4