xrange -> six.moves.range for py3