updated sample programs for clarity