StandardError -> Exception, xrange -> range