cook and merge free energy