Do not use xrange for Python 3 compatibility