exercise 4 code