Exercise 3 in the NTNU course TDT4280