Exercise 5 in the NTNU course TDT4280