Added the codes for exercise 7.3