Made python 3 compatible