changing xrange to range, solving encoding issues