Heating and cooling of buildings