added python3 support, please review