changed to xrange