DAT520 lab4 code