changed range to xrange