added Helmholtz Free Energy and Legendre Transform