functions computed by those authors are adequate for highly ionized gases and for $T \geq 10^4 K$. At high redshifts ($100 > z > 20$) and inside neutral gas clouds a residual electron fraction of about $n_e/n_H \approx 0.005$ is present (Peebles 1993) which is enough to act as a catalyst in chemical reactions producing molecular hydrogen. $H_2$ cooling due to excitation of molecular rotational levels was introduced by using the results of Galli & Palla (1998). After the appearance of the first stars, the gas is enriched by trace elements like O, C, Si, Fe, responsible for a supplementary cooling mechanism. The UV background with $h\nu < 13.6~eV$ is unable to ionize hydrogen (and oxygen) in neutral gas clouds but it can ionize carbon, silicon and iron, which are mostly singly ionized under these conditions. These ions have fine structure levels that can be excited by collisions either with electrons or atomic hydrogen, constituting an important cooling mechanism at low temperatures, which was included in the code. The UV radiation from young massive stars able to ionize the nearby gas was computed for different ionization species of hydrogen and helium, representing not only an additional (local) source of ionization 