make code Python 3 compatible
remove debug output