The accuracy of a pencil-beam algorithm for electrons employing a two-dimensional heterogeneity correction is demonstrated by comparing calculation with measurement. Ionization measurements have been made in a water phantom for a variety of non-standard geometries. Geometries to demonstrate the effect of an extended treatment distance, a sloping skin surface, and an irregular skin surface have been selected. Additionally, thermoluminescent dosimeters have been used to measure distributions in tissue-substitute phantoms, which were designed from individual patient computerized tomographic scans. Three patient scans have been selected: (1) diffuse hystiocytic lymphoma of the left buccal mucosa and retromolar trigone; (2) squamous cell carcinoma of the nose at the columnella ; and (3) carcinoma of the maxillary antrum. Results demonstrate the algorithm's ability to simultaneously account for the isodose shifting as a result of internal heterogeneities and for sidescatter non-equilibrium caused by lateral discontinuities of the skin surface and internal anatomy. The algorithm is shown to generally be accurate to within +/- 4% in the treatment volume or +/- 4 mm in regions of sharp dose gradients as found in the penumbra and distal edge of the beam. Examples of greater disagreement are shown and their physical interpretation discussed.