Fixed errors in program for checkpoint 2