made python 3 compatible