Code for lab in NTNU course TTM4130