A precision measurement of the spin structure functions g