Direct calculation of thermodynamic quantities for the Heisenberg model