correcting the program 4.1 and explaination of 4.1