Update change xrange -> range and iteritems -> items for Python 3