Added HW4 code