Added an answer for exercise 4