add HW 3 code