corrected program 3