corrected demo program