added python 3 support and fixed windows compatiblity