  In this paper we study several partition relations, defined by Saharon
Shelah, and relate them to the Hales-Jewett numbers. In particular we give an
upper bound for the Hales-Jewett numbers using the primitive recursive function
$\mathtt{f}^{8,*}$ which belongs to the class $\mathcal{E}^5$ of the
Grzegorczyk hierarchy and grows slower than the function $\mathtt{f}^{13}$.
This improves the recent result of the first author and Shelah.
