finished Prog2_d