added python3 compatability