changing xrange to range