Completed question 4 in exercise 6