Fixed some code for program1/2