Changed xrange from standard python to six.moves.xrange