My code for HW 1 and 2