Elements of thermodynamics