prob-solving: legendre transform added