A new inversion for the hydrostatic stratification of the sun