fixing range for python 3