xrange calculation is now done using ints