ported to python 3
resolved conflict