Exercise 3 for vettig14 course at KTH