Chemical cycles in the evolution of the earth