fuction for calculating delta G of reactions