Adsorption on heterogeneous surfaces: A new method for evaluating the energy distribution function