Homework exercise 4