lab4 code for DAT520