made python 3 compliant