changing range to xrange