added python 3 support to fix #1