Solution for exercise 2, week 4.