Made python3 compatible