Delete xrange and fix type error(for Python 3)